Further clean up of the code structure.