remove redundant if checking