Template helpers refactoring