CLN: Refactor autoplot.ts