Refactored to remove one "if" statement.
Refactored to remove one "if" statement.