re-factor some of the ui  pre-load code