redo storing tokens and states