WIP.  Code cleanup.