speed improvements

Change-Id: I6fb003fb324d59b4f74af2658c12dfe289f5fba3