Refactored sustain handling into a separate function