refactored for true/false