remove useless variables and comments