refactor new command, thanks @samccone, add test for custom templates