Implement "--mode" switch