refactor and plot to be generic
Move plots to and py