remove unnecessary do blocks