Factor size calculations out into a separate call.