Removed nested if statement