refactoring with multiple virtual inheritance