Refactor the code around the calls to getThreadURL to be shorter.