refactored into directives