Start refactoring state-related things into a State class