refactoring, cleaning, commenting

mostly refactored getting data from a url