Refactoring of directives