Complexity reduction in ModifyEntity

Change-Id: Ic2ddb65cf3476c50e66f48d903d1d22476e4ea2c
Merge "Complexity reduction in ModifyEntity"