repository manager + refactoring