Refactored kml export