Made optional class work for unit testing.