refactoring - 5d control structures