No need to factor this out to a function if it's only used here