Abstracted the USGS code