Refactor LOCATION preprocessing