Added contexts and state support.