A better way to set the current output handler