Refactor: extract out some directives.