refactor lamp module