added self.extract_code