diff --git a/Rakefile b/Rakefile
index a246c8ea674faa5ec4d712ec145571d0e02f79fe..576e54c6cd5f5f15e6c3fd18d9a729ebc24a751b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -28,9 +28,7 @@ $gem_path  = File.join($base_dir, 'pkg', "#{$spec.name}-#{$spec.version}.gem")
 def run(cmd)
   PTY.spawn(cmd) do |output, _input, _pid|
     begin
-      while line = output.gets
-        puts line
-      end
+      output.each { |line| puts line }
     rescue Errno::EIO
     end
   end
@@ -38,7 +36,8 @@ rescue PTY::ChildExited
 end
 
 def built_gem_path
-  Dir[File.join($base_dir, "#{$spec.name}-*.gem")].sort_by { |f| File.mtime(f) }.last
+  Dir[File.join($base_dir, "#{$spec.name}-*.gem")]
+    .max_by { |f| File.mtime(f) }
 end
 
 desc "Build #{$spec.name}-#{$spec.version}.gem into the pkg directory"
diff --git a/lib/nickserver/handler_chain.rb b/lib/nickserver/handler_chain.rb
index 843313e908dbf92acd69c6b68a760a33b806bced..f685a2e7cdcfc4a8fcc7897322ab199c06d92033 100644
--- a/lib/nickserver/handler_chain.rb
+++ b/lib/nickserver/handler_chain.rb
@@ -1,3 +1,5 @@
+require 'English'
+
 #
 # Handler Chain
 #
diff --git a/lib/nickserver/hkp/client.rb b/lib/nickserver/hkp/client.rb
index 3dbb1de8087e01c453558cb5c721d03d0f05bdce..d632a36b97c38664a172cfddc82a4098402f2590 100644
--- a/lib/nickserver/hkp/client.rb
+++ b/lib/nickserver/hkp/client.rb
@@ -1,4 +1,5 @@
 require 'nickserver/hkp'
+require 'nickserver/config'
 
 module Nickserver::Hkp
   #
@@ -35,7 +36,7 @@ module Nickserver::Hkp
     def get(query)
       # in practice, exact=on seems to have no effect
       query = { exact: 'on', options: 'mr' }.merge query
-      response = adapter.get Config.hkp_url, query: query
+      response = adapter.get Nickserver::Config.hkp_url, query: query
       response
     end
   end
diff --git a/lib/nickserver/hkp/key_info.rb b/lib/nickserver/hkp/key_info.rb
index ed386437a28b5364a747b3845b7ad5324ea59c82..5c8b845d07de60ba6514a6fabdb59aceb19974fb 100644
--- a/lib/nickserver/hkp/key_info.rb
+++ b/lib/nickserver/hkp/key_info.rb
@@ -1,65 +1,83 @@
 require 'cgi'
 require 'nickserver/hkp'
 
-#
-# Class to represent the key information result from a query to a key server
-# (but not the key itself).
-#
-# The initialize method parses the hkp 'machine readable' output.
-#
-# format definition of machine readable index output is here:
-# http://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-5.2
-#
 module Nickserver::Hkp
+  #
+  # Class to represent the key information result from a query to a key server
+  # (but not the key itself).
+  #
+  # The initialize method parses the hkp 'machine readable' output.
+  #
+  # format definition of machine readable index output is here:
+  # http://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-5.2
+  #
   class KeyInfo
-    attr_accessor :uids, :keyid, :algo, :flags
+    attr_accessor :uids
 
     def initialize(hkp_record)
       uid_lines = hkp_record.split("\n")
       pub_line  = uid_lines.shift
-      @keyid, @algo, @keylen_s, @creationdate_s, @expirationdate_s, @flags = pub_line.split(':')[1..-1]
-      @uids = []
-      uid_lines.each do |uid_line|
-        uid, _creationdate, _expirationdate, _flags = uid_line.split(':')[1..-1]
-        # for now, ignore the expirationdate and flags of uids. sks does return them anyway
-        @uids << CGI.unescape(uid.sub(/.*<(.+)>.*/, '\1'))
-      end
+      @properties = pub_line.split(':')[1..-1]
+      @uids = extract_uids(uid_lines)
+    end
+
+    def keyid
+      properties.first
+    end
+
+    def algo
+      properties.second
     end
 
     def keylen
-      @keylen ||= @keylen_s.to_i
+      properties[2].to_i
     end
 
     def creationdate
-      @creationdate ||= begin
-        Time.at(@creationdate_s.to_i) if @creationdate_s
-      end
+      created = properties[3]
+      Time.at(created.to_i)
     end
 
     def expirationdate
-      @expirationdate ||= begin
-        Time.at(@expirationdate_s.to_i) if @expirationdate_s
-      end
+      expires = properties[4]
+      Time.at(expires.to_i)
+    end
+
+    def flags
+      properties.last
     end
 
     def rsa?
-      @algo == '1'
+      algo == '1'
     end
 
     def dsa?
-      @algo == '17'
+      algo == '17'
     end
 
     def revoked?
-      @flags =~ /r/
+      flags =~ /r/
     end
 
     def disabled?
-      @flags =~ /d/
+      flags =~ /d/
     end
 
     def expired?
-      @flags =~ /e/
+      flags =~ /e/
+    end
+
+    protected
+
+    attr_reader :properties
+
+    def extract_uids(uid_lines)
+      uid_lines.map do |uid_line|
+        # for now, ignore the expirationdate and flags of uids.
+        # sks does return them anyway
+        uid, _creationdate, _expirationdate, _flags = uid_line.split(':')[1..-1]
+        CGI.unescape(uid.sub(/.*<(.+)>.*/, '\1'))
+      end
     end
   end
 end
diff --git a/lib/nickserver/hkp/parse_key_info.rb b/lib/nickserver/hkp/parse_key_info.rb
index 09dc69ea91e4070ad2f8a32f72c49a23533112a3..c23751bb4d455a1e07442fe3c436839578355b7a 100644
--- a/lib/nickserver/hkp/parse_key_info.rb
+++ b/lib/nickserver/hkp/parse_key_info.rb
@@ -1,11 +1,11 @@
-#
-# Simple parser for Hkp KeyInfo responses.
-#
-# Focus is on simple here. Trying to avoid state and sideeffects.
-# Parsing a response with 12 keys and validating them takes 2ms.
-# So no need for memoization and making things more complex.
-#
 module Nickserver::Hkp
+  #
+  # Simple parser for Hkp KeyInfo responses.
+  #
+  # Focus is on simple here. Trying to avoid state and sideeffects.
+  # Parsing a response with 12 keys and validating them takes 2ms.
+  # So no need for memoization and making things more complex.
+  #
   class ParseKeyInfo
     # for this regexp to work, the source text must end in a trailing "\n",
     # which the output of sks does.
diff --git a/lib/nickserver/wkd/source.rb b/lib/nickserver/wkd/source.rb
index b994c6cc86252c1fa3d209fddb3021c686874337..43f0b2ed6f299e3527860328e3d4d990e20d46dd 100644
--- a/lib/nickserver/wkd/source.rb
+++ b/lib/nickserver/wkd/source.rb
@@ -9,7 +9,9 @@ module Nickserver::Wkd
     def query(email)
       url = Url.new(email)
       status, blob = adapter.get url
-      Hkp::Response.new(email.to_s, armor_key(blob)) if status == 200
+      if status == 200
+        Nickserver::Hkp::Response.new(email.to_s, armor_key(blob))
+      end
     end
 
     protected
diff --git a/lib/nickserver/wkd/url.rb b/lib/nickserver/wkd/url.rb
index 6530efc7b80dc8d27651cfe80cdad7d997972573..0ccff38535da748b5630fd8bba1db76877e365a1 100644
--- a/lib/nickserver/wkd/url.rb
+++ b/lib/nickserver/wkd/url.rb
@@ -1,29 +1,28 @@
 require 'digest/sha1'
 require 'zbase32'
 
-module Nickserver
-  module Wkd
-    class Url
-      def initialize(email)
-        @domain = email.domain.downcase
-        @local_part = email.local_part.downcase
-      end
+module Nickserver::Wkd
+  # The url to lookup the given email address in the web key directory.
+  class Url
+    def initialize(email)
+      @domain = email.domain.downcase
+      @local_part = email.local_part.downcase
+    end
 
-      def to_s
-        "https://#{domain}/.well-known/openpgpkey/hu/#{encoded_digest}"
-      end
+    def to_s
+      "https://#{domain}/.well-known/openpgpkey/hu/#{encoded_digest}"
+    end
 
-      protected
+    protected
 
-      attr_reader :domain, :local_part
+    attr_reader :domain, :local_part
 
-      def encoded_digest
-        ZBase32.encode32(digest.to_i(16).to_s(2))
-      end
+    def encoded_digest
+      ZBase32.encode32(digest.to_i(16).to_s(2))
+    end
 
-      def digest
-        Digest::SHA1.hexdigest local_part
-      end
+    def digest
+      Digest::SHA1.hexdigest local_part
     end
   end
 end
diff --git a/nickserver.gemspec b/nickserver.gemspec
index 035efe51b095e52eded2290553f728c620db3916..aa4b3b8fd2a806da3e55e8462602de1cb5d71042 100644
--- a/nickserver.gemspec
+++ b/nickserver.gemspec
@@ -1,5 +1,7 @@
 # -*- encoding: utf-8 -*-
 
+require 'English'
+
 lib = File.expand_path('../lib', __FILE__)
 $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
 require 'nickserver/version'
@@ -10,8 +12,12 @@ Gem::Specification.new do |gem|
   gem.authors       = ['elijah']
   gem.email         = ['elijah@riseup.net']
   gem.description   = 'Provides a directory service to map uid to public key.'
-  gem.summary       = 'Nickserver provides the ability to map a uid (user@domain.org) to a public key. This is the opposite of a key server, whose job it is to map public key to uid. Nickserver is lightweight and asynchronous.'
   gem.homepage      = 'https://leap.se'
+  gem.summary       = <<-EOSUM
+Nickserver provides the ability to map a uid (user@domain.org) to a public key.
+This is the opposite of a key server, whose job it is to map public key to uid.
+Nickserver is lightweight and asynchronous.
+  EOSUM
 
   gem.files         = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
   gem.executables   = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
diff --git a/test/functional/sample_test.rb b/test/functional/sample_test.rb
index dbd87963379bc9c071129ae28f69867d2cdf5dd0..412555e399c0be14b49cad5a950a322fdd426618 100644
--- a/test/functional/sample_test.rb
+++ b/test/functional/sample_test.rb
@@ -1,3 +1,4 @@
+require 'English'
 require 'support/functional_test'
 
 class SampleTest < FunctionalTest
diff --git a/test/remote/wkd_source_test.rb b/test/remote/wkd_source_test.rb
index 7eaab79bad5bcf85b03605fab5d91ee4589964c9..1ed7ea52c9d13e92ebb4043aa27036bf76d90905 100644
--- a/test/remote/wkd_source_test.rb
+++ b/test/remote/wkd_source_test.rb
@@ -27,14 +27,14 @@ class RemoteWkdSourceTest < CelluloidTest
 
   def assert_pgp_key_in(response)
     json = JSON.parse response.content
-    assert_equal email_with_key.to_s, json['address']
-    refute_empty json['openpgp']
+    assert_equal email_with_key.to_s, json["address"]
+    refute_empty json["openpgp"]
     assert_equal file_content('dewey.pgp.asc'), json['openpgp']
   end
 
   def email_with_key
     uid = 'dewey@test.gnupg.org'
-    email = Nickserver::EmailAddress.new uid
+    Nickserver::EmailAddress.new uid
   end
 
   def source
diff --git a/test/support/http_stub_helper.rb b/test/support/http_stub_helper.rb
index ee50698d088b982a8cf25c28edec6be54dbf0b66..b0ec06946d97227242cc1e50177f93ef8578496a 100644
--- a/test/support/http_stub_helper.rb
+++ b/test/support/http_stub_helper.rb
@@ -16,13 +16,13 @@ module HttpStubHelper
                   Hash
   end
 
-  def stub_sks_vindex_reponse(_uid, response = {})
+  def stub_sks_vindex_reponse(uid, response = {})
     stub_http_get config.hkp_url,
                   response,
-                  query: vindex_query
+                  query: vindex_query(uid)
   end
 
-  def vindex_query
+  def vindex_query(uid)
     { op: 'vindex',
       search: uid,
       exact: 'on',
@@ -30,13 +30,13 @@ module HttpStubHelper
       fingerprint: 'on' }
   end
 
-  def stub_sks_get_reponse(_key_id, response = {})
+  def stub_sks_get_reponse(key_id, response = {})
     stub_http_get config.hkp_url,
                   response,
-                  query: sks_get_query
+                  query: sks_get_query(key_id)
   end
 
-  def sks_get_query
+  def sks_get_query(key_id)
     { op: 'get',
       search: '0x' + key_id,
       exact: 'on',