http: Do move the class instantiation in the conditional block