Refactor packages factory to multiple files
Summary
The packages factory file is getting quite long and can be difficult to navigate. We should split it into multiple files.
Improvements
Easier to navigate code, less chance of errors or duplication.