Optimize demoshield removal code