Code cleanup and private variable refactoring.