refactor mixin with visitor