switched to template and directive