removing anaonymous function calls and applying all named functions