extracted function `divide`