Correcting string equality check
Extracted method