Add extract function.