Hygiene: factor out common code

Change-Id: I6f7f649d6cc6aaadf6fc86bc0de5e970c4b3fb37