Remove unused functions.  Minor cleanups.
Simplify top wrapper.