Various cleanup and reorganization

Change-Id: Ibb2eecab94c8a5cfa396bbe05e531ce66a99fb02