Duplicating the loop is way too much copy pasta to remove one if statement. Pulling the estimate time stuff into a separate function makes sense though. I would push the condition for different key set types into an invokeCallbacks wrapper.