removes unused flags