Refactoring for padrino-gen.