refactor(core_dom/directive): Remove duplicated code