Combine some flags and reduce calls to 'add_flags' function