Code refactoring for padrino-gen