This function isn't needed now that it's only called in one place. The contents should be inlined below.