added some more tests, renamed repository methods, refactored some insides