more work on hackish function removal using profiling