Recognizing the P_4-structure of claw-free graphs and a larger graph class