There also doesn't seem to be test coverage on this function, or its subfunctions.