Gem insternals cleanup