Beginnings of state manager - its functional