fixes and templating