move matcher to own module, minor cleanups