Refactor more lambda hooks into named functions.