big refactoring, where state is mostly decoupled from input parsing.