Notes on refactoring