Small simplification of plotting code