Turning request into its own function