better performance by reducing code

Change-Id: d81600916d3b2924d6a647e957319027b97e64e3