track state better, add some nice asserts