some code cleanup, have the matching working
added basic tests, have complete from repositories now