Refactored Main class so that it injects ResponseHandler and RequestHandler dependencies.