Removed unused functions
Refactor charts
Refactor controller
Add comments