Refactor templates
Add wrap helper method and its test