Refactored model.set