cleaning up db plot functionality