Doesn't this need to happen before `code = self.modules`?