Lightbox, cleaning up code