Made the personalization function generic.