Use xargs instead of apply