refactoring - 6e control structures