moved some helper functions from xval to imdbutils