Better ordering of if statements.