refactoring - 6b control structures