restructured splash screen function