Refactor bool function

Refactor as discussed here: https://github.com/vehiclefits/library/pull/28