refactor + fix chart