Simplify masking when extracting bits