I am working on ticket A. I find something that could be fixed or refactored, but it interferes with keeping focus on the scope of ticket A.
I immediately create a new ticket B to describe the desired change.
I continue working on ticket A at full speed.