implement extract()