Format + code cleanup.

Minor formatting changes
Better naming for variables.