Refactoring of List class