Minor code layout changes and variable name changes