added more template functionality