added util functions, removed redundant code from logger