Refactored for upload to RubyGems