CS: this is very minor but it is nicer to not have negated if condition when they have a else case. e.g.

    if (cond) {
        foo
    } else {
        bar
    }

 instead of

    if (!cond) {
        bar
    } else {
        foo
    }