Added ability to use template 'both'