Major cleanup.
Make API private.