Reformat the code: move braces to newline and remove unnecessary new lines