Refactor to make testing a little more sane
Add -t flag for user defined template