Removes useless statements.