Refactoring on variant