Simplified if/else ladder.