Refactor out to directives part 1