Code cleanup, ensured there is curly braces for if/else statements, and fixed the positioning of the curly braces

GCP-10281

Reviewer: Chezka Arevalo