simplify logic and clean comment