Cleaned up some code in base model.