moved more template logic to Template constructor
wip