moving plots out of server.R into a helper, pulling out more repeated code into helper functions