refactored rhogallery tutorial