refine logical checking