changed to using templates for render functions