refactored and consolidated directives