Refactor checking of loadData