Including moving functions from lambdas into global scope, adding documentation, improvement of error reporting