Improve templating