added Hue integration and code cleanup