main structure refactoring