Refactoring the data preloading