Clean up some legacy code