Added dependecy injection and model.