Cleanup and make Cmd global