Optimize trigger condition.
Splite library to individual module.