replace abstract type by union