read tpl file outside request, add github link
clean up a bit