Refactor local flag variable.
Refactor noop variable into the flags array.