refine API
handing in a pointer is a hack to work around a bug in gcc 4.8 not allowing to copy std::function objects and should be fixed