Refactored convert to domain structure.