Extract necessary strings