Reorgnanizing resources and middleware into directories.