Clean up and simplify resolver.rb.