Remove redundant middleware and update settings