abstracted template build