Provider prototype model ereplaced with proper closures to improve style and performance