refactoring flags
refactoring flags