some code cleanup on the frontend
refactored chart creation in anticipation of adding more