Use lists, a more general class as recommended
Refactor code