early refactoring: unify State and Timing, flatten class structure, add Regex
class to handle&cache regular expression compilation globally.
fix log after refactoring