Refactored ready to start conversion to Canary.