I believe you have Phlox and Peony here in these images.
Yes, it looks like they are leggy and could use a good clean up.
Prune back the Phlox to about 6 inches from the ground. The Peony should actually die back naturally.
These articles will help you.