Better theme event logic