Refactor struct
Refactor type annotation
Generics
Add test