code clean up to consistently handling bundling