Updated for unit testing.