Keeping a software system conformant with a desired architecture and consistent with good design principles is a recurring task during the software evolution process. Deviations from good design principles can manifest in the form of bad smells: problems in the system’s structure that can negatively affect software quality factors. Many authors have worked in identifying bad smells and in removing them with refactorings: tools have been built to suggest refactorings; successful approaches to detect bad smells have been developed, etc. We present a comprehensive and historical review on this subject, in order to model the current state of the art and to identify the open challenges, current trends and research opportunities. We also propose a technique based on automated planning, aimed at taking one step forward in the automatic improvement of a system’s structure. This proposal will allow computing complex refactoring sequences which can be directed to the achievement of a certain objective, such as the correction of bad smells. Presented at IWPSE-EVOL 2009 (http://soft.vub.ac.be/iwpse-evol/2009_start).