Update to make 'smart functors' work with both pointer and non pointer types