Refactored separate domain and ctype