full implementation of helpers for dotcode
rationalize checkTypes code