Major optimization

Change-Id: Ic9b2864976dd559d6ba91fde775463170d2081fc