Rearrange graphic removal code