refactor and add test for nicothumb

oh