You are doing this multiple assignments in `document.py` too... what do you think about "encapsulating" them to be reused here without repeating all the stuff? But... maybe you want them in this form for readability purposes...