minor code re-factor to reduce size of fetchURL function and implement hlint suggestions