tiny refactoring
changed equality check of states