Extract buffer-local var init in a separate function