better fn local handling