refactoring - 5b control structures