Made some parts public for unit testing.