Reorg with some better naming conventions and comments.