Minor code cleaning, add some comments too