refactor Collections::contains