make IsCleared() inline and const