Actually, the factory approach does not require mass pre-declaration and doesn't need to load anything that you don't use, so it's the best approach if you want to stick with the multiple packages approach. The factory method here would figure out the package name dynamically and then do a
require for it, instantiate it, and return it.
I still think you can do it without multiple packages though, if they all share the same methods. You only need multiple packages if every package has different methods.