Moved "unused" variables outside of their ifs