Simplified the implementation of classes in the domain.py file.