More work on template editor