Refactoring code generator