Refactor lightbox