refactoring boolean flags