Refactored code and added geojson elements