extract util code from typelists.cpp