google maps api refactor