union() refactor