Commenting and refining code