Optimize bit extraction