(refactor) Changed ingot to middleware.