lamps management refactor