Cleaning middleware loading.