some refactoring to search mappings