Remove useless code which might throw exception