refactor struct