Enabling Context-aware Applications In Smart Environments