Cleaned up the code a bit and implemented more of the data model
changes.