refactor common flags