Making your data structure more flexible (with interfaces and parameterized types)