refactored google maps api calls