Various code cleanups

Change-Id: I8a323b31d617cd3c89cd7594df7ae67802f314eb