Minor cleanup and variable restructure