A little code clean-up and comments