All developers know this. Written code can always be improved. As a developer I also spent time refactoring my code. Merge methods, extracting methods to new classes, streamlining loops. It’s just everyday business.
Sean Chambers, a blogger on Los Techies, did a great series on refactoring. For one month, he posted an article about one refactoring technique. In total there were 31 posts.
All these articles are now bundled into an excellent eBook, which is available for free download.