initial loading screen code was duplicated in two files, refactored it