Code refactoring: use type embedding in structs