more work on templates