enhance pipeline logic