refactoring - 6i control structures