Code cleanup, keeping back compat

Change-Id: I37f546892ea8ad5369af3e66c16062fab492dd56