Eliminating unneeded function call