Refactor away from self.class. (but it's sketchy)