This needs its own tests.