Extract function.