flags refafctoring