Refactoring in variant implementation