profile fetching logic