Refactoring takeBool
Refactoring example code