refactory:javascript for google map