Move some commonly-used code into a HadoopContextHelper class.