further work customising template code