Introduced Model class, which was not explicitly required beforehand. Some cosmetic code fixes.