Extract pipeline configuration generation logic into a macros
Added support for pipeline templates creation