refactor - start using core.match