Even though this function is only being called once, would it be worth abstracting it out into a generic util function?