We all have to deal with the scarcest resource in development teams: time. This often leads to compromises and shortcuts when writing code. The result is what is called technical debt: the difference between how the code should have been and how it is. Strategies for managing technical debt are many but all require an investment of time and energy, proportional to the amount of debt to be repaid. Is this really the only way? Rector is a tool capable of automating a wide range of refactorings, allowing us to speed up the most tedious manual operations. In this talk we will see how, exploring - rector's basic principles - predefined rules, configurable rules, sets of rules - how to write custom rules