Code cleanup + minor comments