Minor code cleaning and cosmetic adjustments