A few util functions and types.