why move this up here? creates an extra variable, and also instantiates an object which might not be used (if the conditional below is false).