some general purpose utilities