Rework the function.