Refactor preloader