Refactoring line chart