removes unneeded function calls