cleaned up functions.tpl template