Simplify the code in rem() and implement the top level function.  Remove the per class implementations.