change extract function