more refactoring, purification, breakage
refactoring towards removing global state
more refactoring, state management