Created Util class with helper function, so we don't repeat code.