optimize with &&