[refactor] move some templates into smaller templates to be more DRY