Refactored Lights controller