Reverse if/else condition to reduce indentation