Added a util class for rex here