Added more functionalities to trends visualizer.
Cleaned up codes