Parser code clean up and added comments