final plotting refactor