more work on templating