use set to optimize checking for existing gems