google maps js code cleanup