simplified if/then/else