simplify logic with feedback from review.