refactor Util, add documentation