remove unnecessary end