Defined extract function