Moved some utilities over from coz