rename do method to apply

with compability to google closure compiler