preloader refactored