Refactored addBundle and addBundles to prevent duplicating logic.