Optimized the handler a bit