Cleaning up the uri to local code