remove useless function calls