Refactored to entityStateChanged for expository reasons