[gallery-y-common-dombind] refactor to maintain directives more cleaner