Major optimizations

Including removing unused imports

Change-Id: I93eec4121b1d735c2b4c892b97da531d67e96ed1