refactored map repository