refactor template pats into using the template helper