preloader refactor