refactor flag message