Use contains() instead of inlining its code