Yes, and yes. I did this with an iphone 8, I think, which basically gave it a few more years of functionality before the advances to cameras and processors became too great to ignore. I used a kit from iFixit which was pretty easy to use.
FYI: I think the way to gauge your battery is to look up the number of charging cycles it has had. If it's over 1,000, that battery is past its operational lifetime.