remove ifs around yield