make ifs not clone the whole stream