Refactored contains