That would be great. It would also make this function easier to test.