As I was reading the code, I noticed that it would be much easier to understand with type hints. At least on function signatures. Also, enforcing a max line width on the project would help readability.