refactor to RubyGem