remove no-check
generalize a util function