Refactored update