cleaned up menu/mode transition logic