Cleaned up Model code.