More cleaning up; don't expose APIs that don't need exposing.
Shorten the code with inner classes