performance improvements in updateEntity