Removing unused ifs