refactor canHitClose