refactored to work with geojson format