Can you refactor this please and call the function `getProfileData`?