code optimizations to GremlinPipeline and simplifying tokens.