refactoring struct