Simplify logic in one render_plot function inserting the script tags. Also I got rid of the id plot references.