Separated the model into the db module