more refactoring db_load_X and workspace_load()