Refactoring of List implementation