abstract function extraction