moved templating to core controller