refactored splash screen code