refactoring - 6d control structures