fixed some warnings issued by JSHint
removed some unnecessary if statements