implement part of Utility.cpp