initial import of NPAD's mlab-support logic