Raw implementation of getState()