refactoring of booleans