Old Can Lights with plug-ins???

I recently opened up some pre-existing can lights for a remodel on my ceiling and noticed that the can lights have been wired to plug in to an free hanging plug? Has anyone ever seen anything like this? Can I take new lights and cut wires and attach plugs to them rather than getting up in the attic and pulling all of the existing wire out and starting from scratch? Ideas, thoughts, much appreciated.