cleaned up toggling logic