Refactor DirectiveExts