Refactor some of the directives