Reworking how the custom stream handlers are defined