refactor handseal_detect