Cleanup and refactoring of an earlier cl.

Change-Id: I5e356ed88375a1620846e0c500659e3b7ead5030
12 files changed