moved all functionality for querying external data into fetchDataFromExternal. Consequently modified others.