Some refactoring into _util and _plotters