Internal for unit testing.