Make the handlers closures. Make the code more concise.