Event handling improvements
Optimizes the header