Refactor Http pipeline