Fixed indentation.
Refactored if statement.