refactored directive including stability tweaks