can merge these 'ifs'