Use C type casting to optimize pull function.