Refactor flag out.