In order to avoid code duplication (search and catalog, probably layertree later), functions like removeLayerFromMap, addLayerToMap, getMapLayer could all in a service like gaMapUtils. What do you think?