a few util functions that might prove useful