Refactored some stuff for lights