Refactored handle-input-update to use let instead of def