bundle bug fix and performance/refactor optimize.