Updated model, database design and added generic repository class, added more abstractions and did some major refactoring