Refactor HTTP request into its own class