Redid state handling. Finish implementation and tests for data