adding docstrings for most functions in factory