SBOX-78: Handling of flag bands, avoided some code duplication