refactoring - 6h control structures