Documents Identity and small refactoring