refactoring controllers templates generators