Better way of toggling variables