removed unnecessary if statement / redundant code