re arranged helper functions into a util class