remove duplicate draw logic and make one drawChart function

various other small updates