improve structure of plotter routines

Change-Id: I326c37f166f93e48a4bf188968a255f7f03fbeb8
Reviewed-on: http://review.couchbase.org/31133
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>