Code cleaning and comments