reorganizing CFB code