clean up result chart code