Major optimization

Change-Id: I5880875c13c5eebe7e96f126a7037739246fa192