Refactored. Add domain types for convenience