Refactoring Document and Revision models.