rename remaining 'token' to 'function'