Refactored invokable templates to behave as an std::function wrapper (with optimized implementation)