Refactor templating

Trello card: https://trello.com/c/X87U7TOX