Docstrings and simplifications of domains.py