Refactored update method in service