Applying Internet of Things for personalized healthcare in smart homes