move pipe method to scala object Pipe