refactoring code common to the two list implementation in a new
_ListBase class.