removing redundant if statement