We should probably have some tests for this