[major] refactor for easy distribution to other bundles