Validate several class names + improve search performance