wouldn't be better to skip the transition check if the previous state was nil?