Collapse if statements belonging together.