More work on template