cosmetic fixes and code formatting