rewrote apply providers to work without recursion and prototype context creation