Refactor methods into Util class.