Refactor data loading (wip)