Major changes to models, included dependency injection