some structural changes to gem