update internal state abstraction, add index.