rewrite of function profile_load with Mike