Cleanup and change variable names for clarity