Refactor plot1
refactored plot2