refactored EntityState