Added base function for loading models.