Added cleanup method to the model.