revamping the flag construction pipeline