Is there a reason to pull this out to a separate function?