Add support for lists
Refactor