Refactoring map search