Minor refactoring of if statement.