Refactor geoprocessing