improve templating