Removed the if conditions as discussed in the code review.