Refactored to use function mapping for UPDATE