Major optimization

Change-Id: I855ce5e4f9598c2a278b0c6ced4ded9e9cce8241