Moved DOM validation to separate method
Split checking URL or file