move cache function to profileManager