Refactor directives