refactoring repository classes