Factor out terminator handling