refactor struct tests