Recommendations on how to refactor messy scripts/code? (Inheritence, composition, modules, collection service, etc.)

Hey, so I’m intending on cleaning up all my game’s code soon, there’s a lot going on in my game, and a lot of tools, scripts, NPCs, mechanics, etc. And it’s getting large enough to where it’s pretty tedious having to change things and having to copy and paste the same code for things. Every tool has multiple scripts, remote events, similar code.

There’s a lot of options, inheritence, composition, modules, collection service, and multiple ways to do these as well. Anyone have any recommendations on the general structure that have good server performance and keep things dynamic?

i would use a collection service. its simple to use and quite useful. i would make 1 local script for each tool, so that it is much easier to make changes. each tool should also have its own folder to make things simple. also, i wouldnt reccomend doing inheritance, unless it is absolutely essential.