Refactor of lightbox