added more checks
Parsing url
Read file from url - quick and dirty implementation
some refactoring: removed duplicate code
function instead of duplicate code