Major improvement in code readability by using references plus other
code cleanups.