Refactored s-edit directive