separated & state struct
cleaned...