Added payload optimization feature, now no unnecessary code will be added into payload