Refactor code in order to separate each ring custom middleware into its own file.