Python plotter, some refactoring