added inner_ext with a functor rather than a function pointer