refactoring of util methods