Refactor preloading