refactoring Union + tests Union,Optional