added more tests, added repository factory prototype