Port some util stuff from TCon