Cleanup legacy code