Refactored plot class