added extract func