Rename middleware and extract configs loading