Extracts creating request handlers into its own method.