avoid redundant if statement