List refactoring and contains() method