refactor directives