added templating etc