MapQueryService junits and some refactoring