Remove condition loop and a few changes in logic.