union refactor