Move pipeline flushing into objects
Add 'ensure_present' method
Refactor away from Chain class
Remove unnecessary param
Refactor