refactoring - 8a - refactoring control flow