map near cache refactoring