Moved the logic to create profiles to utils. Also added a method to check if a profile exists under an entity.