prototype: refactor MODE flags storage