Optimizing conditional blocks