Major optimization

Change-Id: I426dce7dbcf728d610a9b9e74b136979810aa8b2