Added method State#is. Refactoring.