refactor some logic into pipeline object
add counter
used new refactored pipeline