removed numberOfCalls in favor of a more generic function