Use named functions and reduce some timeout periods.