split StateClass from main
replace State to app.state