refactored directive test