refactor get_lights