Some refactorings to allow introducing non standard document types