Removed some extra whitespace and fixed some indentation issues.
Fixed spacing issues with conditionals, no functional changes.
Removed some const primitives pass by reference since it's slower.

Primitive values don't need to be passed as const by reference.