Adding documentation for factories
merging in fixes