prototype for a unified load function for all file types