Optimize move generator