move big chunk of plotting.py to plotting_helpers.py