Minor optimization by removing unneeded ops