Refactor flag partial