More work on templates