Refactor: Speend up main body detector function

1. package related function to class MainBodyDetector
2. build dictionary to reduce duplication calculate