Refactoring: use _.contains instead of $.inArray