Did some refactoring to make the code more readable
Optimized the Factory path for Documents (in DocumentCollection)