Master Cylinder Spring stuck!

Hello, guys
i'm just trying to replace my master cylinder. I took master cylinder out but the spring and top end got stuck. I tried to take it out and it wouldn't come off. is there any easy way to take it out? or should i just yank it?