Refactor to use |> operator