I think we should add unit tests for this module too. It might be tricky to test this bit without putting it in a function.