Refactored updateModel