remove superfluous test code and avoid changing elements we don't own