moved util methods to library