Moved out JSON files checks into separate function.