Making the calculation of flags easier to read (no necessarily easier to understand though)