if statement refinement