major structure refactoring