Refine the code according Anoop's comments.