large refactor, after verifying regression with all major C* releases