Adding helper functions from HXP