moved extract functionality to own object