rename flags, flag handling