refactor(jqLite): remove code duplication