Refactoring gmaps now with different templates for different functions