unify context and state