remove redundant if statement