Function resolution factored out