account for `value` being false and some minor refactoring