refactored handling of domain for segment features