Clean up add_parseflags function