Code refactoring and model updates.