Map eviction code cleanup & refactorings (maintenance 3.x)

Map eviction code cleanup & refactorings (maintenance 3.x)