Added support for pipeline. perf fix