Refactored plot to make it easier to subclass