Remove some unused code.
Rename some functions to be private.
Add a test to restore coverage.