refactor main into State and Game