refactoring - 6a control structures