Removed debug log.
Implemented some caching to improve performance.
Remove commented code.
Some more optimization.