Refactor code google maps