There should be unit tests for this