This could use a unit test.