General clean up. Pulled out some private classes.