Revert "new sstructure with state.h" new structure had crash issues

This reverts commit b559ce9641eca9bab7b99e29a5defe6518047ebc.