more refactoring: cleaning up booleans in conditional blocks