minor cleanup of loading code