Major optimization

Change-Id: I05fe10f2ad32b3ab44ebbf42db51d89114254d54