rearange some logicals

Change-Id: I58ce892eaed00fdd9dabb245ee1da1fe6b96b29e