Cleanup of url handling