move build middlewares to build/middleware