simpler logic; basic template generation