Implement very basic std::function suppport
Use std::function to simplify code
Clean