refactors create and destroy, to directives