Move functions to map service