This should have a unit test around it.