Refactor Plot class