Current refactoring tools only provide support for performing selected refactorings. We show how tool support can be provided for the preparatory phases of refactoring as well, by determining when a software application should be refactored and which refactoring(s) in particular should be applied. We implemented a tool to detect bad smells and to propose adequate refactorings based on these smells, and validated this tool by carrying out experiments in three concrete case studies: the Soul application, the Smalltalk Collection hierarchy, and the HotDraw application framework. We also show how our tool complements the Smalltalk Refactoring Browser.