Further reduce complexity of modifyEntity

Change-Id: I990dcaf97bdb1c085d1560e6e5833a0b8e42b39b