#type_cast - improve performance & readability

* Number of Comparison of variable `value` when:

        Condition                   Old Method      New Method
        value == true                   2                1
        value == false                  3                2
        value not boolean               2                2

* Avoiding short-circuiting