Fix everything to use flags