Avoid ugly formatting due to a long if statement