Repository: badges/shields
Pull request #3101 (2019-02-25 05:18:37)

Move "good" badge helpers from lib/ to services/
This moves a few helpers from `lib/` to `services/`:

build-status.js
build-status.spec.js
color-formatters.js
color-formatters.spec.js
contributor-count.js
licenses.js
licenses.spec.js
php-version.js
php-version.spec.js
text-formatters.js
text-formatters.spec.js
version.js
version.spec.js

And one from `lib/` to `core/`:

unhandled-rejection.spec.js

The diff is long, but the changes are straightforward.

Ref #2832

shields-ci: 
<!--
  0 failure: 
  66 warning:  Lots 'o changes. ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ..., This PR modified ...
  2 messages
  
  DangerID: danger-id-default;
-->


<table>
  <thead>
    <tr>
      <th width="50"></th>
      <th width="100%" data-danger-table="true">Warnings</th>
    </tr>
  </thead>
  <tbody><tr>
      <td>:warning:</td>
      <td>Lots 'o changes. Skipping diff-based checks.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>f-droid</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>gem</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>hackage</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>hexpm</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>elm-package</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>itunes</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>jenkins</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>jetbrains</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>jitpack</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>lgtm</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>eclipse-marketplace</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>liberapay</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>dub</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>librariesio</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>discourse</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>luarocks</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>date</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>maven-central</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>ctan</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>maven-metadata</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>crates</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>nexus</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>cran</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>nodeping</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>cpan</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>npm</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>coveralls</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>packagecontrol</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>cookbook</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>packagist</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>conda</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>php-eye</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>codecov</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>pub</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>codeclimate</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>puppetforge</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>codacy</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>pypi</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>cocoapods</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>redmine</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>clojars</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>sonarqube</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>cii-best-practices</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>sourceforge</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>chrome-web-store</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>spiget</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>cdnjs</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>stackexchange</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>bstats</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>steam</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>bower</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>symfony</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>bountysource</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>teamcity</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>bintray</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>twitter</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>aur</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>uptimerobot</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>apm</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>vaadin-directory</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>ansible</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>visual-studio-marketplace</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>amo</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>wordpress</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>This PR modified service code for <kbd>homebrew</kbd> but not its test code. <br>That's okay so long as it's refactoring existing code.</td>
    </tr>
  </tbody>
</table>


<table>
  <thead>
    <tr>
      <th width="50"></th>
      <th width="100%" data-danger-table="true">Messages</th>
    </tr>
  </thead>
  <tbody><tr>
      <td>:book:</td>
      <td>:sparkles: Thanks for your contribution to Shields, @paulmelnikow!</td>
    </tr>
  
<tr>
      <td>:book:</td>
      <td>

  Thanks for contributing to our documentation. We :heart: our [documentarians](http://www.writethedocs.org/)!
  </td>
    </tr>
  </tbody>
</table>


<p align="right">
  Generated by :no_entry_sign: <a href="https://danger.systems/js">dangerJS</a> against 561f77f9a6a64eeb8446a1a57cd2b0b696f82dd9
</p>

paulmelnikow: This will keep causing merge conflicts as service are changed. It would be great to get this merged. Have added a list of affected files to the top post.
calebcartwright: I'm can look at this one tonight
calebcartwright: Was debating whether to ask this here or back over on #2832, but how are we qualifying "good" and "bad" for helper functions? 

(not implying any of the functions in this PR are "bad", just not sure what puts a helper into a category)
paulmelnikow: > Is "bad" just helper functions that are for legacy code/that will be unneeded once the service refactor is complete?

Yes, and `regular-update` which needs a total rewrite for async, maybe using [node-cache](https://github.com/mpneuried/nodecache).
paulmelnikow: Thanks for the careful review!

Patch:
diff --git a/lib/unhandled-rejection.spec.js b/core/unhandled-rejection.spec.js
similarity index 100%
rename from lib/unhandled-rejection.spec.js
rename to core/unhandled-rejection.spec.js
diff --git a/doc/TUTORIAL.md b/doc/TUTORIAL.md
index 64694f1017..25491f53a2 100644
--- a/doc/TUTORIAL.md
+++ b/doc/TUTORIAL.md
@@ -1,12 +1,10 @@
-Tutorial on how to add a badge for a service
-============================================
+# Tutorial on how to add a badge for a service
 
 This tutorial should help you add a service to shields.io in form of a badge.
 You will need to learn to use JavaScript, Git and GitHub.
 Please [improve the tutorial](https://github.com/badges/shields/edit/master/doc/TUTORIAL.md) while you read it.
 
-(1) Reading
------------
+## (1) Reading
 
 You should read [CONTRIBUTING.md](../CONTRIBUTING.md)
 
@@ -14,8 +12,7 @@ You can also read previous
 [merged pull-requests with the 'service-badge' label](https://github.com/badges/shields/pulls?utf8=%E2%9C%93&q=is%3Apr+label%3Aservice-badge+is%3Amerged)
 to see how other people implemented their badges.
 
-(2) Setup
----------
+## (2) Setup
 
 ### Pre-requisites
 
@@ -48,25 +45,24 @@ You may also want to install
 This is an optional dependency needed for generating badges in raster format,
 but you can get a dev copy running without it.
 
-(3) Open an Issue
------------------
+## (3) Open an Issue
 
 Before you want to implement your service, you may want to [open an issue](https://github.com/badges/shields/issues/new?template=2_Badge_request.md) and describe what you have in mind:
+
 - What is the badge for?
 - Which API do you want to use?
 
 You may additionally proceed to say what you want to work on.
 This information allows other humans to help and build on your work.
 
-(4) Implementing
-----------------
+## (4) Implementing
 
 ### (4.1) Structure and Layout
 
 Service badge code is stored in the [/services](https://github.com/badges/shields/tree/master/services/) directory.
 Each service has a directory for its files:
 
-* In files ending with `.service.js`, you can find the code which handles
+- In files ending with `.service.js`, you can find the code which handles
   incoming requests and generates the badges.
   Sometimes, code for a service can be re-used.
   This might be the case when you add a badge for an API which is already used
@@ -74,20 +70,21 @@ Each service has a directory for its files:
 
   Imagine a service that lives at https://img.shields.io/example/some-param-here.svg.
 
-  * For services with a single badge, the badge code will generally be stored in
+  - For services with a single badge, the badge code will generally be stored in
     `/services/example/example.service.js`.
     If you add a badge for a new API, create a new directory.
 
     Example: [wercker](https://github.com/badges/shields/tree/master/services/wercker)
 
-  * For service families with multiple badges we usually store the code for each
+  - For service families with multiple badges we usually store the code for each
     badge in its own file like this:
-    * `/services/example/example-downloads.service.js`
-    * `/services/example/example-version.service.js` etc.
+
+    - `/services/example/example-downloads.service.js`
+    - `/services/example/example-version.service.js` etc.
 
     Example: [ruby gems](https://github.com/badges/shields/tree/master/services/gem)
 
-* In files ending with `.tester.js`, you can find the code which uses
+- In files ending with `.tester.js`, you can find the code which uses
   the shields server to test if the badges are generated correctly.
   There is a [chapter on Tests][write tests].
 
@@ -96,32 +93,35 @@ Each service has a directory for its files:
 All service badge classes inherit from [BaseService] or another class which extends it.
 Other classes implement useful behavior on top of [BaseService].
 
-* [BaseJsonService](https://github.com/badges/shields/blob/master/services/base-json.js)
+- [BaseJsonService](https://github.com/badges/shields/blob/master/services/base-json.js)
   implements methods for performing requests to a JSON API and schema validation.
-* [BaseXmlService](https://github.com/badges/shields/blob/master/services/base-xml.js)
+- [BaseXmlService](https://github.com/badges/shields/blob/master/services/base-xml.js)
   implements methods for performing requests to an XML API and schema validation.
-* If you are contributing to a *service family*, you may define a common super
+- If you are contributing to a _service family_, you may define a common super
   class for the badges or one may already exist.
 
-[BaseService]: https://github.com/badges/shields/blob/master/services/base.js
+[baseservice]: https://github.com/badges/shields/blob/master/services/base.js
 
 As a first step we will look at the code for an example which generates a badge without contacting an API.
 
 ```js
-'use strict'                                         // (1)
+'use strict' // (1)
 
-const { BaseService } = require('..')                // (2)
+const { BaseService } = require('..') // (2)
 
-module.exports = class Example extends BaseService { // (3)
+module.exports = class Example extends BaseService {
+  // (3)
 
-  static get route() {                                 // (4)
+  static get route() {
+    // (4)
     return {
       base: 'example',
       pattern: ':text',
     }
   }
 
-  async handle({ text }) {                           // (5)
+  async handle({ text }) {
+    // (5)
     return {
       label: 'example',
       message: text,
@@ -137,15 +137,15 @@ Description of the code:
 2. Our service badge class will extend `BaseService` so we need to require it. Variables are declared with `const` and `let` in preference to `var`.
 3. Our module must export a class which extends `BaseService`.
 4. `route()` declares the URL path at which the service operates. It also maps components of the URL path to handler parameters.
-    * `base` defines the first part of the URL that doesn't change, e.g. `/example/`.
-    * `pattern` defines the variable part of the route, everything that comes after `/example/`. It can include any
-      number of named parameters. These are converted into
-      regular expressions by [`path-to-regexp`][path-to-regexp].
+   - `base` defines the first part of the URL that doesn't change, e.g. `/example/`.
+   - `pattern` defines the variable part of the route, everything that comes after `/example/`. It can include any
+     number of named parameters. These are converted into
+     regular expressions by [`path-to-regexp`][path-to-regexp].
 5. Because a service instance won't be created until it's time to handle a request, the route and other metadata must be obtained by examining the classes themselves. [That's why they're marked `static`.][static]
 6. All badges must implement the `async handle()` function that receives parameters to render the badge. Parameters of `handle()` will match the name defined in `route()` Because we're capturing a single variable called `text` our function signature is `async handle({ text })`. `async` is needed to let JavaScript do other things while we are waiting for result from external API. Although in this simple case, we don't make any external calls. Our `handle()` function should return an object with 3 properties:
-    * `label`: the text on the left side of the badge
-    * `message`: the text on the right side of the badge - here we are passing through the parameter we captured in the route regex
-    * `color`: the background color of the right side of the badge
+   - `label`: the text on the left side of the badge
+   - `message`: the text on the right side of the badge - here we are passing through the parameter we captured in the route regex
+   - `color`: the background color of the right side of the badge
 
 The process of turning this object into an image is handled automatically by the `BaseService` class.
 
@@ -168,56 +168,63 @@ The example above was completely static. In order to make a useful service badge
 This example is based on the [Ruby Gems version](https://github.com/badges/shields/blob/master/services/gem/gem-version.service.js) badge:
 
 ```js
-'use strict'                                                    // (1)
+'use strict' // (1)
 
-const { renderVersionBadge } = require('../../lib/version')     // (2)
-const { BaseJsonService } = require('..')                       // (3)
+const { renderVersionBadge } = require('..//version') // (2)
+const { BaseJsonService } = require('..') // (3)
 
-const Joi = require('joi')                                      // (4)
-const schema = Joi.object({                                     // (4)
-  version: Joi.string().required(),                             // (4)
-}).required()                                                   // (4)
+const Joi = require('joi') // (4)
+const schema = Joi.object({
+  // (4)
+  version: Joi.string().required(), // (4)
+}).required() // (4)
 
-module.exports = class GemVersion extends BaseJsonService {     // (5)
+module.exports = class GemVersion extends BaseJsonService {
+  // (5)
 
-  static get route() {                                          // (6)
+  static get route() {
+    // (6)
     return {
       base: 'gem/v',
       pattern: ':gem',
     }
   }
 
-  static get defaultBadgeData() {                               // (7)
+  static get defaultBadgeData() {
+    // (7)
     return { label: 'gem' }
   }
 
-  async handle({ gem }) {                                       // (8)
+  async handle({ gem }) {
+    // (8)
     const { version } = await this.fetch({ gem })
     return this.constructor.render({ version })
   }
 
-  async fetch({ gem }) {                                        // (9)
+  async fetch({ gem }) {
+    // (9)
     return this._requestJson({
       schema,
       url: `https://rubygems.org/api/v1/gems/${gem}.json`,
     })
   }
 
-  static render({ version }) {                                  // (10)
+  static render({ version }) {
+    // (10)
     return renderVersionBadge({ version })
   }
-
 }
 ```
 
 Description of the code:
+
 1. As with the first example, we declare strict mode at the start of each file.
-2. In this case we are making a version badge, which is a common pattern. Instead of directly returning an object in this badge we will use a helper function to format our data consistently. There are a variety of helper functions to help with common tasks in `/lib`. Some useful generic helpers can be found in:
-    * [build-status.js](https://github.com/badges/shields/blob/master/lib/build-status.js)
-    * [color-formatters.js](https://github.com/badges/shields/blob/master/lib/color-formatters.js)
-    * [licenses.js](https://github.com/badges/shields/blob/master/lib/licenses.js)
-    * [text-formatters.js](https://github.com/badges/shields/blob/master/lib/text-formatters.js)
-    * [version.js](https://github.com/badges/shields/blob/master/lib/version.js)
+2. In this case we are making a version badge, which is a common pattern. Instead of directly returning an object in this badge we will use a helper function to format our data consistently. There are a variety of helper functions to help with common tasks in `/services`. Some useful generic helpers can be found in:
+   - [build-status.js](https://github.com/badges/shields/blob/master/services/build-status.js)
+   - [color-formatters.js](https://github.com/badges/shields/blob/master/services/color-formatters.js)
+   - [licenses.js](https://github.com/badges/shields/blob/master/services/licenses.js)
+   - [text-formatters.js](https://github.com/badges/shields/blob/master/services/text-formatters.js)
+   - [version.js](https://github.com/badges/shields/blob/master/services/version.js)
 3. Our badge will query a JSON API so we will extend `BaseJsonService` instead of `BaseService`. This contains some helpers to reduce the need for boilerplate when calling a JSON API.
 4. We perform input validation by defining a schema which we expect the JSON we receive to conform to. This is done using [Joi](https://github.com/hapijs/joi). Defining a schema means we can ensure the JSON we receive meets our expectations and throw an error if we receive unexpected input without having to explicitly code validation checks. The schema also acts as a filter on the JSON object. Any properties we're going to reference need to be validated, otherwise they will be filtered out. In this case our schema declares that we expect to receive an object which must have a property called 'status', which is a string.
 5. Our module exports a class which extends `BaseJsonService`
@@ -225,21 +232,21 @@ Description of the code:
 7. We can use `defaultBadgeData()` to set a default `color`, `logo` and/or `label`. If `handle()` doesn't return any of these keys, we'll use the default. Instead of explicitly setting the label text when we return a badge object, we'll use `defaultBadgeData()` here to define it declaratively.
 8. Our badge must implement the `async handle()` function. Because our URL pattern captures a variable called `gem`, our function signature is `async handle({ gem })`. We usually separate the process of generating a badge into 2 stages or concerns: fetch and render. The `fetch()` function is responsible for calling an API endpoint to get data. The `render()` function formats the data for display. In a case where there is a lot of calculation or intermediate steps, this pattern may be thought of as fetch, transform, render and it might be necessary to define some helper functions to assist with the 'transform' step.
 9. The `async fetch()` method is responsible for calling an API endpoint to get data. Extending `BaseJsonService` gives us the helper function `_requestJson()`. Note here that we pass the schema we defined in step 4 as an argument. `_requestJson()` will deal with validating the response against the schema and throwing an error if necessary.
-    * `_requestJson()` automatically adds an Accept header, checks the status code, parses the response as JSON, and returns the parsed response.
-    * `_requestJson()` uses [request](https://github.com/request/request) to perform the HTTP request. Options can be passed to request, including method, query string, and headers. If headers are provided they will override the ones automatically set by `_requestJson()`. There is no need to specify json, as the JSON parsing is handled by `_requestJson()`. See the `request` docs for [supported options](https://github.com/request/request#requestoptions-callback).
-    * Error messages corresponding to each status code can be returned by passing a dictionary of status codes -> messages in `errorMessages`.
-    * A more complex call to `_requestJson()` might look like this:
-        ```js
-        return this._requestJson({
-          schema: mySchema,
-          url,
-          options: { qs: { branch: 'master' } },
-          errorMessages: {
-            401: 'private application not supported',
-            404: 'application not found',
-          },
-        })
-        ```
+   - `_requestJson()` automatically adds an Accept header, checks the status code, parses the response as JSON, and returns the parsed response.
+   - `_requestJson()` uses [request](https://github.com/request/request) to perform the HTTP request. Options can be passed to request, including method, query string, and headers. If headers are provided they will override the ones automatically set by `_requestJson()`. There is no need to specify json, as the JSON parsing is handled by `_requestJson()`. See the `request` docs for [supported options](https://github.com/request/request#requestoptions-callback).
+   - Error messages corresponding to each status code can be returned by passing a dictionary of status codes -> messages in `errorMessages`.
+   - A more complex call to `_requestJson()` might look like this:
+     ```js
+     return this._requestJson({
+       schema: mySchema,
+       url,
+       options: { qs: { branch: 'master' } },
+       errorMessages: {
+         401: 'private application not supported',
+         404: 'application not found',
+       },
+     })
+     ```
 10. The `static render()` method is responsible for formatting the data for display. `render()` is a pure function so we can make it a `static` method. By convention we declare functions which don't reference `this` as `static`. We could explicitly return an object here, as we did in the previous example. In this case, we will hand the version string off to `renderVersionBadge()` which will format it consistently and set an appropriate color. Because `renderVersionBadge()` doesn't return a `label` key, the default label we defined in `defaultBadgeData()` will be used when we generate the badge.
 
 This code allows us to call this URL <https://img.shields.io/gem/v/formatador.svg> to generate this badge: ![](https://img.shields.io/gem/v/formatador.svg)
@@ -248,10 +255,10 @@ It is also worth considering the code we _haven't_ written here. Note that our e
 
 Specifically `BaseJsonService` will handle the following errors for us:
 
-* API does not respond
-* API responds with a non-`200 OK` status code
-* API returns a response which can't be parsed as JSON
-* API returns a response which doesn't validate against our schema
+- API does not respond
+- API responds with a non-`200 OK` status code
+- API returns a response which can't be parsed as JSON
+- API returns a response which doesn't validate against our schema
 
 Sometimes it may be necessary to manually throw an exception to deal with a
 non-standard error condition. If so, there are several standard exceptions that can be used. These exceptions are defined in
@@ -268,19 +275,20 @@ throw new NotFound({ prettyMessage: 'package not found' })
 
 Once we have implemented our badge, we can add it to the index so that users can discover it. We will do this by adding a couple of additional methods to our class.
 
-
 ```js
 module.exports = class GemVersion extends BaseJsonService {
-
   // ...
 
-  static get category() {                                       // (1)
+  static get category() {
+    // (1)
     return 'version'
   }
 
-  static get examples() {                                       // (2)
+  static get examples() {
+    // (2)
     return [
-      {                                                         // (3)
+      {
+        // (3)
         title: 'Gem',
         namedParams: { gem: 'formatador' },
         staticPreview: this.render({ version: '2.1.0' }),
@@ -288,25 +296,24 @@ module.exports = class GemVersion extends BaseJsonService {
       },
     ]
   }
-
 }
 ```
 
 1. The `category()` property defines which heading in the index our example will appear under.
 2. The examples property defines an array of examples. In this case the array will contain a single object, but in some cases it is helpful to provide multiple usage examples.
 3. Our example object should contain the following properties:
-    * `title`: Descriptive text that will be shown next to the badge
-    * `namedParams`: Provide a valid example of params we can substitute into
-      the pattern. In this case we need a valid ruby gem, so we've picked [formatador](https://rubygems.org/gems/formatador).
-    * `staticPreview`: On the index page we want to show an example badge, but for performance reasons we want that example to be generated without making an API call. `staticPreview` should be populated by calling our `render()` method with some valid data.
-    * `keywords`: If we want to provide additional keywords other than the title, we can add them here. This helps users to search for relevant badges.
+   - `title`: Descriptive text that will be shown next to the badge
+   - `namedParams`: Provide a valid example of params we can substitute into
+     the pattern. In this case we need a valid ruby gem, so we've picked [formatador](https://rubygems.org/gems/formatador).
+   - `staticPreview`: On the index page we want to show an example badge, but for performance reasons we want that example to be generated without making an API call. `staticPreview` should be populated by calling our `render()` method with some valid data.
+   - `keywords`: If we want to provide additional keywords other than the title, we can add them here. This helps users to search for relevant badges.
 
 Save, run `npm start`, and you can see it [locally](http://127.0.0.1:3000/).
 
-If you update `examples`, you don't have to restart the server. Run `npm run
-defs` in another terminal window and the frontend will update.
+If you update `examples`, you don't have to restart the server. Run `npm run defs` in another terminal window and the frontend will update.
 
 ### (4.5) Write Tests <!-- Change the link below when you change the heading -->
+
 [write tests]: #45-write-tests
 
 When creating a badge for a new service or changing a badge's behavior, tests
@@ -334,12 +341,13 @@ token or credentials are for and how to obtain them.
 ## (5) Create a Pull Request
 
 Once you have implemented a new badge:
-* Before submitting your changes, please review the [coding guidelines](https://github.com/badges/shields/blob/master/CONTRIBUTING.md#coding-guidelines).
-* [Create a pull-request](https://help.github.com/articles/creating-a-pull-request/) to propose your changes.
-* CI will check the tests pass and that your code conforms to our coding standards.
-* We also use [Danger](https://danger.systems/) to check for some common problems. The first comment on your pull request will be posted by a bot. If there are any errors or warnings raised, please review them.
-* One of the
-[maintainers](https://github.com/badges/shields/blob/master/README.md#project-leaders)
-will review your contribution.
-* We'll work with you to progress your contribution suggesting improvements if necessary. Although there are some occasions where a contribution is not appropriate, if your contribution conforms to our [guidelines](https://github.com/badges/shields/blob/master/CONTRIBUTING.md#badge-guidelines) we'll aim to work towards merging it. The majority of pull requests adding a service badge are merged.
-* If your contribution is merged, the final comment on the pull request will be an automated post which you can monitor to tell when your contribution has been deployed to production.
+
+- Before submitting your changes, please review the [coding guidelines](https://github.com/badges/shields/blob/master/CONTRIBUTING.md#coding-guidelines).
+- [Create a pull-request](https://help.github.com/articles/creating-a-pull-request/) to propose your changes.
+- CI will check the tests pass and that your code conforms to our coding standards.
+- We also use [Danger](https://danger.systems/) to check for some common problems. The first comment on your pull request will be posted by a bot. If there are any errors or warnings raised, please review them.
+- One of the
+  [maintainers](https://github.com/badges/shields/blob/master/README.md#project-leaders)
+  will review your contribution.
+- We'll work with you to progress your contribution suggesting improvements if necessary. Although there are some occasions where a contribution is not appropriate, if your contribution conforms to our [guidelines](https://github.com/badges/shields/blob/master/CONTRIBUTING.md#badge-guidelines) we'll aim to work towards merging it. The majority of pull requests adding a service badge are merged.
+- If your contribution is merged, the final comment on the pull request will be an automated post which you can monitor to tell when your contribution has been deployed to production.
diff --git a/scripts/refactoring-cli.js b/scripts/refactoring-cli.js
index 357d6d0cf8..c0fa06bc2f 100644
--- a/scripts/refactoring-cli.js
+++ b/scripts/refactoring-cli.js
@@ -2,7 +2,7 @@
 
 const chalk = require('chalk')
 const { namedColors } = require('../gh-badges/lib/color')
-const { floorCount } = require('../lib/color-formatters')
+const { floorCount } = require('../services/color-formatters')
 const { loadServiceClasses } = require('../core/base-service/loader')
 
 const serviceClasses = loadServiceClasses()
diff --git a/services/amo/amo-downloads.service.js b/services/amo/amo-downloads.service.js
index 356ec2a24e..9a2864cb1a 100644
--- a/services/amo/amo-downloads.service.js
+++ b/services/amo/amo-downloads.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount } = require('../color-formatters')
 const { redirector } = require('..')
 const { BaseAmoService, keywords } = require('./amo-base')
 
diff --git a/services/amo/amo-rating.service.js b/services/amo/amo-rating.service.js
index 27623e2794..4a81e2820a 100644
--- a/services/amo/amo-rating.service.js
+++ b/services/amo/amo-rating.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { starRating } = require('../../lib/text-formatters')
-const { floorCount: floorCountColor } = require('../../lib/color-formatters')
+const { starRating } = require('../text-formatters')
+const { floorCount: floorCountColor } = require('../color-formatters')
 const { BaseAmoService, keywords } = require('./amo-base')
 
 module.exports = class AmoRating extends BaseAmoService {
diff --git a/services/amo/amo-users.service.js b/services/amo/amo-users.service.js
index 8b32ab3c3d..09dfad14a1 100644
--- a/services/amo/amo-users.service.js
+++ b/services/amo/amo-users.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { BaseAmoService, keywords } = require('./amo-base')
 
 module.exports = class AmoUsers extends BaseAmoService {
diff --git a/services/amo/amo-version.service.js b/services/amo/amo-version.service.js
index db34d635e9..6691273523 100644
--- a/services/amo/amo-version.service.js
+++ b/services/amo/amo-version.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { BaseAmoService, keywords } = require('./amo-base')
 
 module.exports = class AmoVersion extends BaseAmoService {
diff --git a/services/ansible/ansible-quality.service.js b/services/ansible/ansible-quality.service.js
index 16eed6a4f8..64eadf429a 100644
--- a/services/ansible/ansible-quality.service.js
+++ b/services/ansible/ansible-quality.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { floorCount } = require('../../lib/color-formatters')
+const { floorCount } = require('../color-formatters')
 const { BaseJsonService, InvalidResponse } = require('..')
 
 const ansibleContentSchema = Joi.object({
diff --git a/services/ansible/ansible-role.service.js b/services/ansible/ansible-role.service.js
index e987da5574..00d29ae3e1 100644
--- a/services/ansible/ansible-role.service.js
+++ b/services/ansible/ansible-role.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { downloadCount } = require('../../lib/color-formatters')
-const { metric } = require('../../lib/text-formatters')
+const { downloadCount } = require('../color-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/apm/apm.service.js b/services/apm/apm.service.js
index 9844927f34..91061ff657 100644
--- a/services/apm/apm.service.js
+++ b/services/apm/apm.service.js
@@ -1,9 +1,9 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderLicenseBadge } = require('../../lib/licenses')
-const { renderVersionBadge } = require('../../lib/version')
-const { metric } = require('../../lib/text-formatters')
+const { renderLicenseBadge } = require('../licenses')
+const { renderVersionBadge } = require('../version')
+const { metric } = require('../text-formatters')
 const { BaseJsonService, InvalidResponse } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/appveyor/appveyor-base.js b/services/appveyor/appveyor-base.js
index e8b1902434..6dea851976 100644
--- a/services/appveyor/appveyor-base.js
+++ b/services/appveyor/appveyor-base.js
@@ -3,7 +3,7 @@
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
 const { nonNegativeInteger } = require('../validators')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 
 const schema = Joi.object({
   build: Joi.object({
diff --git a/services/appveyor/appveyor-ci.service.js b/services/appveyor/appveyor-ci.service.js
index e8548afdcb..1e3dc87b08 100644
--- a/services/appveyor/appveyor-ci.service.js
+++ b/services/appveyor/appveyor-ci.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderBuildStatusBadge } = require('../../lib/build-status')
+const { renderBuildStatusBadge } = require('../build-status')
 const AppVeyorBase = require('./appveyor-base')
 
 module.exports = class AppVeyorCi extends AppVeyorBase {
diff --git a/services/aur/aur.service.js b/services/aur/aur.service.js
index 1b1e4d304a..4e6ebd7fab 100644
--- a/services/aur/aur.service.js
+++ b/services/aur/aur.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { floorCount: floorCountColor } = require('../../lib/color-formatters')
-const { addv, metric } = require('../../lib/text-formatters')
+const { floorCount: floorCountColor } = require('../color-formatters')
+const { addv, metric } = require('../text-formatters')
 const { BaseJsonService, NotFound } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/azure-devops/azure-devops-build.service.js b/services/azure-devops/azure-devops-build.service.js
index e713638af5..411657cfcc 100644
--- a/services/azure-devops/azure-devops-build.service.js
+++ b/services/azure-devops/azure-devops-build.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderBuildStatusBadge } = require('../../lib/build-status')
+const { renderBuildStatusBadge } = require('../build-status')
 const { BaseSvgScrapingService, NotFound } = require('..')
 const { keywords, fetch } = require('./azure-devops-helpers')
 
diff --git a/services/azure-devops/azure-devops-coverage.service.js b/services/azure-devops/azure-devops-coverage.service.js
index 04a53f930c..838a52889b 100644
--- a/services/azure-devops/azure-devops-coverage.service.js
+++ b/services/azure-devops/azure-devops-coverage.service.js
@@ -3,7 +3,7 @@
 const Joi = require('joi')
 const {
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 const AzureDevOpsBase = require('./azure-devops-base')
 const { keywords, getHeaders } = require('./azure-devops-helpers')
 
diff --git a/services/azure-devops/azure-devops-helpers.js b/services/azure-devops/azure-devops-helpers.js
index 15b80926ce..645e80a692 100644
--- a/services/azure-devops/azure-devops-helpers.js
+++ b/services/azure-devops/azure-devops-helpers.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const serverSecrets = require('../../lib/server-secrets')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 
 const keywords = ['vso', 'vsts', 'azure-devops']
 
diff --git a/services/azure-devops/azure-devops-release.service.js b/services/azure-devops/azure-devops-release.service.js
index 88f7449e9b..0bbc6ab41f 100644
--- a/services/azure-devops/azure-devops-release.service.js
+++ b/services/azure-devops/azure-devops-release.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderBuildStatusBadge } = require('../../lib/build-status')
+const { renderBuildStatusBadge } = require('../build-status')
 const { BaseSvgScrapingService } = require('..')
 const { keywords, fetch } = require('./azure-devops-helpers')
 
diff --git a/services/bintray/bintray.service.js b/services/bintray/bintray.service.js
index e04709868d..e3f31577ef 100644
--- a/services/bintray/bintray.service.js
+++ b/services/bintray/bintray.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const serverSecrets = require('../../lib/server-secrets')
 const { BaseJsonService } = require('..')
 
diff --git a/services/bitbucket/bitbucket-issues.service.js b/services/bitbucket/bitbucket-issues.service.js
index 81f0f334aa..c781942f06 100644
--- a/services/bitbucket/bitbucket-issues.service.js
+++ b/services/bitbucket/bitbucket-issues.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/bitbucket/bitbucket-pipelines.service.js b/services/bitbucket/bitbucket-pipelines.service.js
index 3efee06fa8..9de40ec205 100644
--- a/services/bitbucket/bitbucket-pipelines.service.js
+++ b/services/bitbucket/bitbucket-pipelines.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderBuildStatusBadge } = require('../../lib/build-status')
+const { renderBuildStatusBadge } = require('../build-status')
 const { BaseJsonService } = require('..')
 
 const bitbucketPipelinesSchema = Joi.object({
diff --git a/services/bitbucket/bitbucket-pull-request.service.js b/services/bitbucket/bitbucket-pull-request.service.js
index 7e8803cb98..0ca5a25638 100644
--- a/services/bitbucket/bitbucket-pull-request.service.js
+++ b/services/bitbucket/bitbucket-pull-request.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const serverSecrets = require('../../lib/server-secrets')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { nonNegativeInteger, optionalUrl } = require('../validators')
 const { BaseJsonService } = require('..')
 
diff --git a/services/bountysource/bountysource.service.js b/services/bountysource/bountysource.service.js
index 5f8538dabd..9a759b1a2f 100644
--- a/services/bountysource/bountysource.service.js
+++ b/services/bountysource/bountysource.service.js
@@ -3,7 +3,7 @@
 const { BaseJsonService } = require('..')
 const Joi = require('joi')
 const { nonNegativeInteger } = require('../validators')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 
 const schema = Joi.object({ activity_total: nonNegativeInteger })
 
diff --git a/services/bower/bower-license.service.js b/services/bower/bower-license.service.js
index 3ce517833a..e82e388704 100644
--- a/services/bower/bower-license.service.js
+++ b/services/bower/bower-license.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderLicenseBadge } = require('../../lib/licenses')
+const { renderLicenseBadge } = require('../licenses')
 const BaseBowerService = require('./bower-base')
 
 module.exports = class BowerLicense extends BaseBowerService {
diff --git a/services/bower/bower-version.service.js b/services/bower/bower-version.service.js
index 8b88a8c9f0..42018f621a 100644
--- a/services/bower/bower-version.service.js
+++ b/services/bower/bower-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const BaseBowerService = require('./bower-base')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { InvalidResponse } = require('..')
 
 module.exports = class BowerVersion extends BaseBowerService {
diff --git a/services/bstats/bstats-players.service.js b/services/bstats/bstats-players.service.js
index 84b3ddd37e..13efcdae73 100644
--- a/services/bstats/bstats-players.service.js
+++ b/services/bstats/bstats-players.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
 
 const schema = Joi.array()
diff --git a/services/bstats/bstats-servers.service.js b/services/bstats/bstats-servers.service.js
index 6a5b71e928..f93e899768 100644
--- a/services/bstats/bstats-servers.service.js
+++ b/services/bstats/bstats-servers.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
 
 const schema = Joi.array()
diff --git a/services/cdnjs/cdnjs.service.js b/services/cdnjs/cdnjs.service.js
index c0754892de..ffe4c83884 100644
--- a/services/cdnjs/cdnjs.service.js
+++ b/services/cdnjs/cdnjs.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { BaseJsonService, NotFound } = require('..')
 
 const cdnjsSchema = Joi.object({
diff --git a/services/chrome-web-store/chrome-web-store.service.js b/services/chrome-web-store/chrome-web-store.service.js
index 5b8c0edb30..29031f8e63 100644
--- a/services/chrome-web-store/chrome-web-store.service.js
+++ b/services/chrome-web-store/chrome-web-store.service.js
@@ -5,16 +5,13 @@ const {
   makeBadgeData: getBadgeData,
   makeLabel: getLabel,
 } = require('../../lib/badge-data')
-const { metric, starRating } = require('../../lib/text-formatters')
+const { metric, starRating } = require('../text-formatters')
 const {
   downloadCount: downloadCountColor,
   floorCount: floorCountColor,
   version: versionColor,
-} = require('../../lib/color-formatters')
-const {
-  addv: versionText,
-  currencyFromCode,
-} = require('../../lib/text-formatters')
+} = require('../color-formatters')
+const { addv: versionText, currencyFromCode } = require('../text-formatters')
 
 const commonExample = {
   title: 'Chrome Web Store',
diff --git a/services/cii-best-practices/cii-best-practices.service.js b/services/cii-best-practices/cii-best-practices.service.js
index 27a35e1273..2cfe9d58bc 100644
--- a/services/cii-best-practices/cii-best-practices.service.js
+++ b/services/cii-best-practices/cii-best-practices.service.js
@@ -4,7 +4,7 @@ const Joi = require('joi')
 const {
   colorScale,
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 const { BaseJsonService } = require('..')
 
 const ciiBestPracticesSchema = Joi.object({
diff --git a/services/circleci/circleci.service.js b/services/circleci/circleci.service.js
index 5bb6c6a876..7ca7a39a9f 100644
--- a/services/circleci/circleci.service.js
+++ b/services/circleci/circleci.service.js
@@ -1,10 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const {
-  isBuildStatus,
-  renderBuildStatusBadge,
-} = require('../../lib/build-status')
+const { isBuildStatus, renderBuildStatusBadge } = require('../build-status')
 const { BaseJsonService } = require('..')
 
 const circleSchema = Joi.array()
diff --git a/services/clojars/clojars-downloads.service.js b/services/clojars/clojars-downloads.service.js
index 7cea2f15ae..953b1d5857 100644
--- a/services/clojars/clojars-downloads.service.js
+++ b/services/clojars/clojars-downloads.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount: downloadsColor } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount: downloadsColor } = require('../color-formatters')
 const { nonNegativeInteger } = require('../validators')
 const { BaseJsonService } = require('..')
 
diff --git a/services/clojars/clojars-version.service.js b/services/clojars/clojars-version.service.js
index 0b2d99367f..a3b0d2d5f9 100644
--- a/services/clojars/clojars-version.service.js
+++ b/services/clojars/clojars-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { version: versionColor } = require('../../lib/color-formatters')
+const { version: versionColor } = require('../color-formatters')
 const { BaseJsonService, NotFound } = require('..')
 
 const clojarsSchema = Joi.object({
diff --git a/services/cocoapods/cocoapods-docs.service.js b/services/cocoapods/cocoapods-docs.service.js
index 6110b651bd..30b2125863 100644
--- a/services/cocoapods/cocoapods-docs.service.js
+++ b/services/cocoapods/cocoapods-docs.service.js
@@ -2,7 +2,7 @@
 
 const {
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
 
diff --git a/services/cocoapods/cocoapods-version.service.js b/services/cocoapods/cocoapods-version.service.js
index 8ecf96f96e..1b2e516c2a 100644
--- a/services/cocoapods/cocoapods-version.service.js
+++ b/services/cocoapods/cocoapods-version.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const BaseCocoaPodsService = require('./cocoapods-base')
 
 module.exports = class CocoapodsVersion extends BaseCocoaPodsService {
diff --git a/services/codacy/codacy-coverage.service.js b/services/codacy/codacy-coverage.service.js
index adc9a4718b..4c21ff96f4 100644
--- a/services/codacy/codacy-coverage.service.js
+++ b/services/codacy/codacy-coverage.service.js
@@ -3,7 +3,7 @@
 const Joi = require('joi')
 const {
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 const { BaseSvgScrapingService } = require('..')
 const { NotFound } = require('..')
 
diff --git a/services/codeclimate/codeclimate.service.js b/services/codeclimate/codeclimate.service.js
index d1f0c0e7b1..28184d85e9 100644
--- a/services/codeclimate/codeclimate.service.js
+++ b/services/codeclimate/codeclimate.service.js
@@ -6,7 +6,7 @@ const {
   coveragePercentage: coveragePercentageColor,
   letterScore: letterScoreColor,
   colorScale,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 
 class CodeclimateCoverage extends LegacyService {
   static get route() {
diff --git a/services/codecov/codecov.service.js b/services/codecov/codecov.service.js
index 6c5e19ffb8..a2df0e7c1a 100644
--- a/services/codecov/codecov.service.js
+++ b/services/codecov/codecov.service.js
@@ -5,7 +5,7 @@ const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const {
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/lib/color-formatters.js b/services/color-formatters.js
similarity index 100%
rename from lib/color-formatters.js
rename to services/color-formatters.js
diff --git a/lib/color-formatters.spec.js b/services/color-formatters.spec.js
similarity index 100%
rename from lib/color-formatters.spec.js
rename to services/color-formatters.spec.js
diff --git a/services/conda/conda-downloads.service.js b/services/conda/conda-downloads.service.js
index ab381d8d7a..9b02e866f7 100644
--- a/services/conda/conda-downloads.service.js
+++ b/services/conda/conda-downloads.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount } = require('../color-formatters')
 const BaseCondaService = require('./conda-base')
 
 module.exports = class CondaDownloads extends BaseCondaService {
diff --git a/services/conda/conda-version.service.js b/services/conda/conda-version.service.js
index c88d5a896f..80db23a467 100644
--- a/services/conda/conda-version.service.js
+++ b/services/conda/conda-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { addv: versionText } = require('../../lib/text-formatters')
-const { version: versionColor } = require('../../lib/color-formatters')
+const { addv: versionText } = require('../text-formatters')
+const { version: versionColor } = require('../color-formatters')
 const BaseCondaService = require('./conda-base')
 
 module.exports = class CondaVersion extends BaseCondaService {
diff --git a/lib/contributor-count.js b/services/contributor-count.js
similarity index 100%
rename from lib/contributor-count.js
rename to services/contributor-count.js
diff --git a/services/cookbook/cookbook.service.js b/services/cookbook/cookbook.service.js
index fe9828fa06..249d8f4a92 100644
--- a/services/cookbook/cookbook.service.js
+++ b/services/cookbook/cookbook.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 
 const schema = Joi.object({ version: Joi.string().required() }).required()
 
diff --git a/services/coveralls/coveralls.service.js b/services/coveralls/coveralls.service.js
index 8f21f44f52..0abef1ae48 100644
--- a/services/coveralls/coveralls.service.js
+++ b/services/coveralls/coveralls.service.js
@@ -4,7 +4,7 @@ const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const {
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/services/cpan/cpan-version.service.js b/services/cpan/cpan-version.service.js
index f6800b1ef2..57a60bda4c 100644
--- a/services/cpan/cpan-version.service.js
+++ b/services/cpan/cpan-version.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const BaseCpanService = require('./cpan')
 
 module.exports = class CpanVersion extends BaseCpanService {
diff --git a/services/cran/cran.service.js b/services/cran/cran.service.js
index 3a9638b731..305dc00a01 100644
--- a/services/cran/cran.service.js
+++ b/services/cran/cran.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 
 const schema = Joi.object({
   License: Joi.string().required(),
diff --git a/services/crates/crates-downloads.service.js b/services/crates/crates-downloads.service.js
index 9a5990357b..0abd998ae1 100644
--- a/services/crates/crates-downloads.service.js
+++ b/services/crates/crates-downloads.service.js
@@ -1,9 +1,7 @@
 'use strict'
 
-const {
-  downloadCount: downloadCountColor,
-} = require('../../lib/color-formatters')
-const { metric } = require('../../lib/text-formatters')
+const { downloadCount: downloadCountColor } = require('../color-formatters')
+const { metric } = require('../text-formatters')
 const { BaseCratesService, keywords } = require('./crates-base')
 
 module.exports = class CratesDownloads extends BaseCratesService {
diff --git a/services/crates/crates-version.service.js b/services/crates/crates-version.service.js
index a526d6fa41..43119c1614 100644
--- a/services/crates/crates-version.service.js
+++ b/services/crates/crates-version.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { BaseCratesService, keywords } = require('./crates-base')
 
 module.exports = class CratesVersion extends BaseCratesService {
diff --git a/services/ctan/ctan.service.js b/services/ctan/ctan.service.js
index 0c1deab770..d647b064f1 100644
--- a/services/ctan/ctan.service.js
+++ b/services/ctan/ctan.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderLicenseBadge } = require('../../lib/licenses')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderLicenseBadge } = require('../licenses')
+const { renderVersionBadge } = require('../version')
 const { BaseJsonService } = require('..')
 
 const schema = Joi.object({
diff --git a/services/date/date.service.js b/services/date/date.service.js
index f3727a8e6a..1f0a3f0839 100644
--- a/services/date/date.service.js
+++ b/services/date/date.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { formatRelativeDate } = require('../../lib/text-formatters')
+const { formatRelativeDate } = require('../text-formatters')
 const { BaseService } = require('..')
 
 const documentation = `
diff --git a/services/discourse/discourse.service.js b/services/discourse/discourse.service.js
index 96a8fa710e..ab5e38c29c 100644
--- a/services/discourse/discourse.service.js
+++ b/services/discourse/discourse.service.js
@@ -3,7 +3,7 @@
 const camelcase = require('camelcase')
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { nonNegativeInteger } = require('../validators')
 
 const schema = Joi.object({
diff --git a/services/docker/docker-pulls.service.js b/services/docker/docker-pulls.service.js
index 96deddfb8a..e01b7c4c45 100644
--- a/services/docker/docker-pulls.service.js
+++ b/services/docker/docker-pulls.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
 const { nonNegativeInteger } = require('../validators')
 const {
diff --git a/services/docker/docker-stars.service.js b/services/docker/docker-stars.service.js
index f17b401632..72bad7c408 100644
--- a/services/docker/docker-stars.service.js
+++ b/services/docker/docker-stars.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { BaseService } = require('..')
 const { nonNegativeInteger } = require('../validators')
 const {
diff --git a/services/dub/dub-download.service.js b/services/dub/dub-download.service.js
index 0cfa3ddb19..ac9061a559 100644
--- a/services/dub/dub-download.service.js
+++ b/services/dub/dub-download.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount } = require('../color-formatters')
 const { BaseJsonService } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/dub/dub-license.service.js b/services/dub/dub-license.service.js
index ca064350ae..9d58a2e647 100644
--- a/services/dub/dub-license.service.js
+++ b/services/dub/dub-license.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderLicenseBadge } = require('../../lib/licenses')
+const { renderLicenseBadge } = require('../licenses')
 const { BaseJsonService } = require('..')
 
 const schema = Joi.object({
diff --git a/services/dub/dub-version.service.js b/services/dub/dub-version.service.js
index c8acc910dd..bdfad6e92e 100644
--- a/services/dub/dub-version.service.js
+++ b/services/dub/dub-version.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 
 const schema = Joi.string().required()
 
diff --git a/services/eclipse-marketplace/eclipse-marketplace-downloads.service.js b/services/eclipse-marketplace/eclipse-marketplace-downloads.service.js
index 991441d4f8..5f4020f292 100644
--- a/services/eclipse-marketplace/eclipse-marketplace-downloads.service.js
+++ b/services/eclipse-marketplace/eclipse-marketplace-downloads.service.js
@@ -1,10 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
-const {
-  downloadCount: downloadCountColor,
-} = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount: downloadCountColor } = require('../color-formatters')
 const { nonNegativeInteger } = require('../validators')
 const EclipseMarketplaceBase = require('./eclipse-marketplace-base')
 
diff --git a/services/eclipse-marketplace/eclipse-marketplace-update.service.js b/services/eclipse-marketplace/eclipse-marketplace-update.service.js
index 41ea27e2a6..d4b148d6cb 100644
--- a/services/eclipse-marketplace/eclipse-marketplace-update.service.js
+++ b/services/eclipse-marketplace/eclipse-marketplace-update.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { formatDate } = require('../../lib/text-formatters')
-const { age: ageColor } = require('../../lib/color-formatters')
+const { formatDate } = require('../text-formatters')
+const { age: ageColor } = require('../color-formatters')
 const { nonNegativeInteger } = require('../validators')
 const EclipseMarketplaceBase = require('./eclipse-marketplace-base')
 
diff --git a/services/eclipse-marketplace/eclipse-marketplace-version.service.js b/services/eclipse-marketplace/eclipse-marketplace-version.service.js
index d9b5dda00b..2211dcfd9d 100644
--- a/services/eclipse-marketplace/eclipse-marketplace-version.service.js
+++ b/services/eclipse-marketplace/eclipse-marketplace-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const EclipseMarketplaceBase = require('./eclipse-marketplace-base')
 
 const versionResponseSchema = Joi.object({
diff --git a/services/elm-package/elm-package.service.js b/services/elm-package/elm-package.service.js
index 994b697bad..6b4a180e67 100644
--- a/services/elm-package/elm-package.service.js
+++ b/services/elm-package/elm-package.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { BaseJsonService } = require('..')
 const { semver } = require('../validators')
 
diff --git a/services/f-droid/f-droid.service.js b/services/f-droid/f-droid.service.js
index 3f2b6279c0..503bd2b951 100644
--- a/services/f-droid/f-droid.service.js
+++ b/services/f-droid/f-droid.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { addv } = require('../../lib/text-formatters')
-const { version: versionColor } = require('../../lib/color-formatters')
+const { addv } = require('../text-formatters')
+const { version: versionColor } = require('../color-formatters')
 const { BaseYamlService, InvalidResponse } = require('..')
 
 const schema = Joi.object({
diff --git a/services/gem/gem-downloads.service.js b/services/gem/gem-downloads.service.js
index 88b7fabf70..95454c81dd 100644
--- a/services/gem/gem-downloads.service.js
+++ b/services/gem/gem-downloads.service.js
@@ -2,9 +2,9 @@
 
 const semver = require('semver')
 const Joi = require('joi')
-const { downloadCount } = require('../../lib/color-formatters')
-const { metric } = require('../../lib/text-formatters')
-const { latest: latestVersion } = require('../../lib/version')
+const { downloadCount } = require('../color-formatters')
+const { metric } = require('../text-formatters')
+const { latest: latestVersion } = require('../version')
 const { BaseJsonService, InvalidParameter, InvalidResponse } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/gem/gem-owner.service.js b/services/gem/gem-owner.service.js
index 95a8fbbc09..02cb4d869f 100644
--- a/services/gem/gem-owner.service.js
+++ b/services/gem/gem-owner.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
-const { floorCount: floorCountColor } = require('../../lib/color-formatters')
+const { floorCount: floorCountColor } = require('../color-formatters')
 
 const ownerSchema = Joi.array().required()
 
diff --git a/services/gem/gem-rank.service.js b/services/gem/gem-rank.service.js
index 2e2e704fee..55bdf2f463 100644
--- a/services/gem/gem-rank.service.js
+++ b/services/gem/gem-rank.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { floorCount } = require('../../lib/color-formatters')
-const { ordinalNumber } = require('../../lib/text-formatters')
+const { floorCount } = require('../color-formatters')
+const { ordinalNumber } = require('../text-formatters')
 const { BaseJsonService, InvalidResponse } = require('..')
 
 const keywords = ['ruby']
diff --git a/services/gem/gem-version.service.js b/services/gem/gem-version.service.js
index bb384629cd..a6247174e0 100644
--- a/services/gem/gem-version.service.js
+++ b/services/gem/gem-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { BaseJsonService } = require('..')
 
 const schema = Joi.object({
diff --git a/services/github/github-commit-activity.service.js b/services/github/github-commit-activity.service.js
index a7940c0129..2cde67f500 100644
--- a/services/github/github-commit-activity.service.js
+++ b/services/github/github-commit-activity.service.js
@@ -3,7 +3,7 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const {
   documentation,
   checkErrorResponse: githubCheckErrorResponse,
diff --git a/services/github/github-contributors.service.js b/services/github/github-contributors.service.js
index f2b376214f..6e532f5378 100644
--- a/services/github/github-contributors.service.js
+++ b/services/github/github-contributors.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const parseLinkHeader = require('parse-link-header')
-const { renderContributorBadge } = require('../../lib/contributor-count')
+const { renderContributorBadge } = require('../contributor-count')
 const { GithubAuthService } = require('./github-auth-service')
 const { documentation, errorMessagesFor } = require('./github-helpers')
 
diff --git a/services/github/github-downloads.service.js b/services/github/github-downloads.service.js
index 2709d927bb..4f3323b658 100644
--- a/services/github/github-downloads.service.js
+++ b/services/github/github-downloads.service.js
@@ -3,7 +3,7 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const {
   documentation,
   checkErrorResponse: githubCheckErrorResponse,
diff --git a/services/github/github-helpers.js b/services/github/github-helpers.js
index 95d7f1b988..6e31be25d0 100644
--- a/services/github/github-helpers.js
+++ b/services/github/github-helpers.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const serverSecrets = require('../../lib/server-secrets')
-const { colorScale } = require('../../lib/color-formatters')
+const { colorScale } = require('../color-formatters')
 const {
   checkErrorResponse: standardCheckErrorResponse,
 } = require('../../lib/error-helper')
diff --git a/services/github/github-issue-detail.service.js b/services/github/github-issue-detail.service.js
index c1ca7fe7f0..c4debed4f5 100644
--- a/services/github/github-issue-detail.service.js
+++ b/services/github/github-issue-detail.service.js
@@ -6,8 +6,8 @@ const {
   makeBadgeData: getBadgeData,
 } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { formatDate } = require('../../lib/text-formatters')
-const { age: ageColor } = require('../../lib/color-formatters')
+const { formatDate } = require('../text-formatters')
+const { age: ageColor } = require('../color-formatters')
 const {
   documentation,
   stateColor: githubStateColor,
diff --git a/services/github/github-issues.service.js b/services/github/github-issues.service.js
index 4b9ba49920..85340a3138 100644
--- a/services/github/github-issues.service.js
+++ b/services/github/github-issues.service.js
@@ -3,7 +3,7 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const {
   documentation,
   checkErrorResponse: githubCheckErrorResponse,
diff --git a/services/github/github-last-commit.service.js b/services/github/github-last-commit.service.js
index a72dd102c6..8eb5c350c4 100644
--- a/services/github/github-last-commit.service.js
+++ b/services/github/github-last-commit.service.js
@@ -3,8 +3,8 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { formatDate } = require('../../lib/text-formatters')
-const { age: ageColor } = require('../../lib/color-formatters')
+const { formatDate } = require('../text-formatters')
+const { age: ageColor } = require('../color-formatters')
 const {
   documentation,
   checkErrorResponse: githubCheckErrorResponse,
diff --git a/services/github/github-license.service.js b/services/github/github-license.service.js
index 6f35df555e..479187742b 100644
--- a/services/github/github-license.service.js
+++ b/services/github/github-license.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderLicenseBadge } = require('../../lib/licenses')
+const { renderLicenseBadge } = require('../licenses')
 const { GithubAuthService } = require('./github-auth-service')
 const { documentation, errorMessagesFor } = require('./github-helpers')
 
diff --git a/services/github/github-manifest.service.js b/services/github/github-manifest.service.js
index c5aecb9413..3aaac1c90d 100644
--- a/services/github/github-manifest.service.js
+++ b/services/github/github-manifest.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const {
   individualValueSchema,
   transformAndValidate,
diff --git a/services/github/github-package-json.service.js b/services/github/github-package-json.service.js
index 9abf7d25b6..aa23978613 100644
--- a/services/github/github-package-json.service.js
+++ b/services/github/github-package-json.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const {
   transformAndValidate,
   renderDynamicBadge,
diff --git a/services/github/github-release-date.service.js b/services/github/github-release-date.service.js
index 9a43b6f09d..5ebae883ac 100644
--- a/services/github/github-release-date.service.js
+++ b/services/github/github-release-date.service.js
@@ -4,8 +4,8 @@ const moment = require('moment')
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { formatDate } = require('../../lib/text-formatters')
-const { age } = require('../../lib/color-formatters')
+const { formatDate } = require('../text-formatters')
+const { age } = require('../color-formatters')
 const { documentation } = require('./github-helpers')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
diff --git a/services/github/github-release.service.js b/services/github/github-release.service.js
index 77eff90bf5..ec708376a6 100644
--- a/services/github/github-release.service.js
+++ b/services/github/github-release.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { addv } = require('../../lib/text-formatters')
+const { addv } = require('../text-formatters')
 const { GithubAuthService } = require('./github-auth-service')
 const { errorMessagesFor, documentation } = require('./github-helpers')
 
diff --git a/services/github/github-search.service.js b/services/github/github-search.service.js
index 4cd64cddae..0e1d65b0af 100644
--- a/services/github/github-search.service.js
+++ b/services/github/github-search.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { nonNegativeInteger } = require('../validators')
 const { GithubAuthService } = require('./github-auth-service')
 const { errorMessagesFor, documentation } = require('./github-helpers')
diff --git a/services/github/github-stars.service.js b/services/github/github-stars.service.js
index e3ec308861..d65d230340 100644
--- a/services/github/github-stars.service.js
+++ b/services/github/github-stars.service.js
@@ -3,7 +3,7 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const {
   documentation,
   checkErrorResponse: githubCheckErrorResponse,
diff --git a/services/github/github-tag.service.js b/services/github/github-tag.service.js
index 4401933387..3cb1d80a74 100644
--- a/services/github/github-tag.service.js
+++ b/services/github/github-tag.service.js
@@ -3,9 +3,9 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { addv: versionText } = require('../../lib/text-formatters')
-const { version: versionColor } = require('../../lib/color-formatters')
-const { latest: latestVersion } = require('../../lib/version')
+const { addv: versionText } = require('../text-formatters')
+const { version: versionColor } = require('../color-formatters')
+const { latest: latestVersion } = require('../version')
 const {
   documentation,
   checkErrorResponse: githubCheckErrorResponse,
diff --git a/services/gitlab/gitlab-pipeline-status.service.js b/services/gitlab/gitlab-pipeline-status.service.js
index 91dedb22c0..f9e12aacce 100644
--- a/services/gitlab/gitlab-pipeline-status.service.js
+++ b/services/gitlab/gitlab-pipeline-status.service.js
@@ -1,10 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const {
-  isBuildStatus,
-  renderBuildStatusBadge,
-} = require('../../lib/build-status')
+const { isBuildStatus, renderBuildStatusBadge } = require('../build-status')
 const { BaseSvgScrapingService, NotFound } = require('..')
 const { optionalUrl } = require('../validators')
 
diff --git a/services/hackage/hackage-version.service.js b/services/hackage/hackage-version.service.js
index ed3e85cbaa..738b5397b9 100644
--- a/services/hackage/hackage-version.service.js
+++ b/services/hackage/hackage-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const { BaseService, InvalidResponse } = require('..')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 
 module.exports = class HackageVersion extends BaseService {
   static get category() {
diff --git a/services/hexpm/hexpm.service.js b/services/hexpm/hexpm.service.js
index 418d6c31d9..237772fb9a 100644
--- a/services/hexpm/hexpm.service.js
+++ b/services/hexpm/hexpm.service.js
@@ -1,11 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric, addv, maybePluralize } = require('../../lib/text-formatters')
-const {
-  downloadCount,
-  version: versionColor,
-} = require('../../lib/color-formatters')
+const { metric, addv, maybePluralize } = require('../text-formatters')
+const { downloadCount, version: versionColor } = require('../color-formatters')
 const { BaseJsonService } = require('..')
 
 const hexSchema = Joi.object({
diff --git a/services/homebrew/homebrew.service.js b/services/homebrew/homebrew.service.js
index 5c500fbd98..71f4b07a07 100644
--- a/services/homebrew/homebrew.service.js
+++ b/services/homebrew/homebrew.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { BaseJsonService } = require('..')
 
 const schema = Joi.object({
diff --git a/services/itunes/itunes.service.js b/services/itunes/itunes.service.js
index 4ab5ff24e2..fb84c61e84 100644
--- a/services/itunes/itunes.service.js
+++ b/services/itunes/itunes.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { BaseJsonService, NotFound } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/jenkins/jenkins-coverage.service.js b/services/jenkins/jenkins-coverage.service.js
index 02970666b8..8b174e8124 100644
--- a/services/jenkins/jenkins-coverage.service.js
+++ b/services/jenkins/jenkins-coverage.service.js
@@ -5,7 +5,7 @@ const { BaseJsonService } = require('..')
 const serverSecrets = require('../../lib/server-secrets')
 const {
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 
 const jacocoCoverageSchema = Joi.object({
   instructionCoverage: Joi.object({
diff --git a/services/jenkins/jenkins-plugin-installs.service.js b/services/jenkins/jenkins-plugin-installs.service.js
index 459b876a7c..a86433d54a 100644
--- a/services/jenkins/jenkins-plugin-installs.service.js
+++ b/services/jenkins/jenkins-plugin-installs.service.js
@@ -1,10 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const {
-  downloadCount: downloadCountColor,
-} = require('../../lib/color-formatters')
-const { metric } = require('../../lib/text-formatters')
+const { downloadCount: downloadCountColor } = require('../color-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService, NotFound } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/jenkins/jenkins-plugin-version.service.js b/services/jenkins/jenkins-plugin-version.service.js
index faf0bf7c3c..facea3e515 100644
--- a/services/jenkins/jenkins-plugin-version.service.js
+++ b/services/jenkins/jenkins-plugin-version.service.js
@@ -3,8 +3,8 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { regularUpdate } = require('../../lib/regular-update')
-const { addv: versionText } = require('../../lib/text-formatters')
-const { version: versionColor } = require('../../lib/color-formatters')
+const { addv: versionText } = require('../text-formatters')
+const { version: versionColor } = require('../color-formatters')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/services/jetbrains/jetbrains-downloads.service.js b/services/jetbrains/jetbrains-downloads.service.js
index e08305a3b8..108767a49d 100644
--- a/services/jetbrains/jetbrains-downloads.service.js
+++ b/services/jetbrains/jetbrains-downloads.service.js
@@ -1,10 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
-const {
-  downloadCount: downloadCountColor,
-} = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount: downloadCountColor } = require('../color-formatters')
 const { nonNegativeInteger } = require('../validators')
 const JetbrainsBase = require('./jetbrains-base')
 
diff --git a/services/jetbrains/jetbrains-version.service.js b/services/jetbrains/jetbrains-version.service.js
index ce3643024e..27ed1f48ed 100644
--- a/services/jetbrains/jetbrains-version.service.js
+++ b/services/jetbrains/jetbrains-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const JetbrainsBase = require('./jetbrains-base')
 
 const schema = Joi.object({
diff --git a/services/jitpack/jitpack.service.js b/services/jitpack/jitpack.service.js
index e8fc449b1a..33429d9582 100644
--- a/services/jitpack/jitpack.service.js
+++ b/services/jitpack/jitpack.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 
 const schema = Joi.object({
   version: Joi.string().required(),
diff --git a/services/jsdelivr/jsdelivr-base.js b/services/jsdelivr/jsdelivr-base.js
index fc3002abea..949dbc32ac 100644
--- a/services/jsdelivr/jsdelivr-base.js
+++ b/services/jsdelivr/jsdelivr-base.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { downloadCount } = require('../../lib/color-formatters')
-const { metric } = require('../../lib/text-formatters')
+const { downloadCount } = require('../color-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
 
 const schema = Joi.object({
diff --git a/services/lgtm/lgtm-alerts.service.js b/services/lgtm/lgtm-alerts.service.js
index 60460b1d32..cad99dcc21 100644
--- a/services/lgtm/lgtm-alerts.service.js
+++ b/services/lgtm/lgtm-alerts.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const LgtmBaseService = require('./lgtm-base')
 
 module.exports = class LgtmAlerts extends LgtmBaseService {
diff --git a/services/liberapay/liberapay-base.js b/services/liberapay/liberapay-base.js
index 97fbdf18fc..f4978f5cb4 100644
--- a/services/liberapay/liberapay-base.js
+++ b/services/liberapay/liberapay-base.js
@@ -1,9 +1,9 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
-const { colorScale } = require('../../lib/color-formatters')
+const { colorScale } = require('../color-formatters')
 const { nonNegativeInteger } = require('../validators')
 
 const schema = Joi.object({
diff --git a/services/liberapay/liberapay-goal.service.js b/services/liberapay/liberapay-goal.service.js
index 23f0ab4f8a..a2a77061bb 100644
--- a/services/liberapay/liberapay-goal.service.js
+++ b/services/liberapay/liberapay-goal.service.js
@@ -2,7 +2,7 @@
 
 const { InvalidResponse } = require('..')
 const { LiberapayBase } = require('./liberapay-base')
-const { colorScale } = require('../../lib/color-formatters')
+const { colorScale } = require('../color-formatters')
 
 module.exports = class LiberapayGoal extends LiberapayBase {
   static get route() {
diff --git a/services/liberapay/liberapay-patrons.service.js b/services/liberapay/liberapay-patrons.service.js
index 72455543a3..1f8e7fc60d 100644
--- a/services/liberapay/liberapay-patrons.service.js
+++ b/services/liberapay/liberapay-patrons.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
-const { colorScale } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { colorScale } = require('../color-formatters')
 const { LiberapayBase } = require('./liberapay-base')
 
 module.exports = class LiberapayPatrons extends LiberapayBase {
diff --git a/services/librariesio/librariesio-dependent-repos.service.js b/services/librariesio/librariesio-dependent-repos.service.js
index 0184b51a41..82537fec70 100644
--- a/services/librariesio/librariesio-dependent-repos.service.js
+++ b/services/librariesio/librariesio-dependent-repos.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const LibrariesIoBase = require('./librariesio-base')
 
 // https://libraries.io/api#project-dependent-repositories
diff --git a/services/librariesio/librariesio-dependents.service.js b/services/librariesio/librariesio-dependents.service.js
index 6dbf4cc4a0..49805f84d6 100644
--- a/services/librariesio/librariesio-dependents.service.js
+++ b/services/librariesio/librariesio-dependents.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const LibrariesIoBase = require('./librariesio-base')
 
 // https://libraries.io/api#project-dependents
diff --git a/services/librariesio/librariesio-sourcerank.service.js b/services/librariesio/librariesio-sourcerank.service.js
index 006d30048c..46009baf79 100644
--- a/services/librariesio/librariesio-sourcerank.service.js
+++ b/services/librariesio/librariesio-sourcerank.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { colorScale } = require('../../lib/color-formatters')
+const { colorScale } = require('../color-formatters')
 const LibrariesIoBase = require('./librariesio-base')
 
 const sourceRankColor = colorScale([10, 15, 20, 25, 30])
diff --git a/lib/licenses.js b/services/licenses.js
similarity index 97%
rename from lib/licenses.js
rename to services/licenses.js
index 2ce34ad2e2..05e8c457ea 100644
--- a/lib/licenses.js
+++ b/services/licenses.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { toArray } = require('./badge-data')
+const { toArray } = require('../lib/badge-data')
 
 const licenseTypes = {
   // permissive licenses - not public domain and not copyleft
diff --git a/lib/licenses.spec.js b/services/licenses.spec.js
similarity index 100%
rename from lib/licenses.spec.js
rename to services/licenses.spec.js
diff --git a/services/luarocks/luarocks-version-helpers.js b/services/luarocks/luarocks-version-helpers.js
index 8ebc42d0e3..66c0e0fc19 100644
--- a/services/luarocks/luarocks-version-helpers.js
+++ b/services/luarocks/luarocks-version-helpers.js
@@ -5,7 +5,7 @@
  */
 'use strict'
 
-const { omitv } = require('../../lib/text-formatters')
+const { omitv } = require('../text-formatters')
 
 // Compare two arrays containing split and transformed to
 // positive/negative numbers parts of version strings,
diff --git a/services/luarocks/luarocks.service.js b/services/luarocks/luarocks.service.js
index abd97b810f..6da0d91b08 100644
--- a/services/luarocks/luarocks.service.js
+++ b/services/luarocks/luarocks.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const { BaseJsonService, NotFound } = require('..')
-const { addv } = require('../../lib/text-formatters')
+const { addv } = require('../text-formatters')
 const { latestVersion } = require('./luarocks-version-helpers')
 
 const schema = Joi.object({
diff --git a/services/maven-central/maven-central.service.js b/services/maven-central/maven-central.service.js
index 652bcac99a..8007083a7c 100644
--- a/services/maven-central/maven-central.service.js
+++ b/services/maven-central/maven-central.service.js
@@ -3,8 +3,8 @@
 const xml2js = require('xml2js')
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
-const { addv: versionText } = require('../../lib/text-formatters')
-const { version: versionColor } = require('../../lib/color-formatters')
+const { addv: versionText } = require('../text-formatters')
+const { version: versionColor } = require('../color-formatters')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/services/maven-metadata/maven-metadata.service.js b/services/maven-metadata/maven-metadata.service.js
index 13b1267a8c..1136257ada 100644
--- a/services/maven-metadata/maven-metadata.service.js
+++ b/services/maven-metadata/maven-metadata.service.js
@@ -2,7 +2,7 @@
 
 const Joi = require('joi')
 const { BaseXmlService } = require('..')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 
 const schema = Joi.object({
   metadata: Joi.object({
diff --git a/services/nexus/nexus.service.js b/services/nexus/nexus.service.js
index 367c19f46a..955899899b 100644
--- a/services/nexus/nexus.service.js
+++ b/services/nexus/nexus.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { version: versionColor } = require('../../lib/color-formatters')
-const { addv } = require('../../lib/text-formatters')
+const { version: versionColor } = require('../color-formatters')
+const { addv } = require('../text-formatters')
 const serverSecrets = require('../../lib/server-secrets')
 const { BaseJsonService, InvalidResponse, NotFound } = require('..')
 const {
diff --git a/services/nodeping/nodeping-uptime.service.js b/services/nodeping/nodeping-uptime.service.js
index 3b1c8ff510..215cb6ed59 100644
--- a/services/nodeping/nodeping-uptime.service.js
+++ b/services/nodeping/nodeping-uptime.service.js
@@ -2,7 +2,7 @@
 
 const { BaseJsonService } = require('..')
 const Joi = require('joi')
-const { colorScale } = require('../../lib/color-formatters')
+const { colorScale } = require('../color-formatters')
 const colorFormatter = colorScale([99, 99.5, 100])
 
 const rowSchema = Joi.object().keys({
diff --git a/services/npm/npm-collaborators.service.js b/services/npm/npm-collaborators.service.js
index ce341a60f3..36f0c98c11 100644
--- a/services/npm/npm-collaborators.service.js
+++ b/services/npm/npm-collaborators.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderContributorBadge } = require('../../lib/contributor-count')
+const { renderContributorBadge } = require('../contributor-count')
 const NpmBase = require('./npm-base')
 
 const keywords = ['node']
diff --git a/services/npm/npm-downloads.service.js b/services/npm/npm-downloads.service.js
index a4283fc803..922b7248c5 100644
--- a/services/npm/npm-downloads.service.js
+++ b/services/npm/npm-downloads.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/npm/npm-license.service.js b/services/npm/npm-license.service.js
index 9e403b58cc..b22250f252 100644
--- a/services/npm/npm-license.service.js
+++ b/services/npm/npm-license.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderLicenseBadge } = require('../../lib/licenses')
+const { renderLicenseBadge } = require('../licenses')
 const { toArray } = require('../../lib/badge-data')
 const NpmBase = require('./npm-base')
 
diff --git a/services/npm/npm-version.service.js b/services/npm/npm-version.service.js
index a2211826eb..f5e45214db 100644
--- a/services/npm/npm-version.service.js
+++ b/services/npm/npm-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { NotFound } = require('..')
 const NpmBase = require('./npm-base')
 
diff --git a/services/nuget/nuget-helpers.js b/services/nuget/nuget-helpers.js
index 8fefd7291c..849cac3ef6 100644
--- a/services/nuget/nuget-helpers.js
+++ b/services/nuget/nuget-helpers.js
@@ -1,9 +1,7 @@
 'use strict'
 
-const { metric, addv } = require('../../lib/text-formatters')
-const {
-  downloadCount: downloadCountColor,
-} = require('../../lib/color-formatters')
+const { metric, addv } = require('../text-formatters')
+const { downloadCount: downloadCountColor } = require('../color-formatters')
 
 function renderVersionBadge({ version, feed }) {
   let color
diff --git a/services/packagecontrol/packagecontrol.service.js b/services/packagecontrol/packagecontrol.service.js
index 304f0b0544..52569efef0 100644
--- a/services/packagecontrol/packagecontrol.service.js
+++ b/services/packagecontrol/packagecontrol.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount } = require('../color-formatters')
 const { BaseJsonService } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/packagist/packagist-downloads.service.js b/services/packagist/packagist-downloads.service.js
index 6c61a763e5..6f774362c8 100644
--- a/services/packagist/packagist-downloads.service.js
+++ b/services/packagist/packagist-downloads.service.js
@@ -2,10 +2,8 @@
 
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
-const { metric } = require('../../lib/text-formatters')
-const {
-  downloadCount: downloadCountColor,
-} = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount: downloadCountColor } = require('../color-formatters')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/services/packagist/packagist-version.service.js b/services/packagist/packagist-version.service.js
index ea760cd971..4e13b8169e 100644
--- a/services/packagist/packagist-version.service.js
+++ b/services/packagist/packagist-version.service.js
@@ -2,13 +2,13 @@
 
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
-const { addv: versionText } = require('../../lib/text-formatters')
-const { version: versionColor } = require('../../lib/color-formatters')
+const { addv: versionText } = require('../text-formatters')
+const { version: versionColor } = require('../color-formatters')
 const {
   compare: phpVersionCompare,
   latest: phpLatestVersion,
   isStable: phpStableVersion,
-} = require('../../lib/php-version')
+} = require('../php-version')
 
 const keywords = ['PHP']
 
diff --git a/services/php-eye/php-eye-hhvm.service.js b/services/php-eye/php-eye-hhvm.service.js
index 7e3ae2f384..4aface7b30 100644
--- a/services/php-eye/php-eye-hhvm.service.js
+++ b/services/php-eye/php-eye-hhvm.service.js
@@ -3,7 +3,7 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { checkErrorResponse } = require('../../lib/error-helper')
-const { omitv } = require('../../lib/text-formatters')
+const { omitv } = require('../text-formatters')
 
 const keywords = ['php', 'runtime']
 
diff --git a/services/php-eye/php-eye-php-version.service.js b/services/php-eye/php-eye-php-version.service.js
index 7b3ac2cee0..ed6a1b1cc5 100644
--- a/services/php-eye/php-eye-php-version.service.js
+++ b/services/php-eye/php-eye-php-version.service.js
@@ -2,11 +2,11 @@
 
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
+const log = require('../../core/server/log')
 const {
   versionReduction: phpVersionReduction,
   getPhpReleases,
-} = require('../../lib/php-version')
-const log = require('../../core/server/log')
+} = require('../php-version')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/lib/php-version.js b/services/php-version.js
similarity index 99%
rename from lib/php-version.js
rename to services/php-version.js
index abb8ae73a5..f8b4d4ecf2 100644
--- a/lib/php-version.js
+++ b/services/php-version.js
@@ -7,9 +7,9 @@
 
 const { promisify } = require('util')
 const request = require('request')
+const { regularUpdate } = require('../lib/regular-update')
 const { listCompare } = require('./version')
 const { omitv } = require('./text-formatters')
-const { regularUpdate } = require('./regular-update')
 
 // Return a negative value if v1 < v2,
 // zero if v1 = v2, a positive value otherwise.
diff --git a/lib/php-version.spec.js b/services/php-version.spec.js
similarity index 100%
rename from lib/php-version.spec.js
rename to services/php-version.spec.js
diff --git a/services/pub/pub.service.js b/services/pub/pub.service.js
index 4404aa4fd7..2368c3952f 100644
--- a/services/pub/pub.service.js
+++ b/services/pub/pub.service.js
@@ -2,8 +2,7 @@
 
 const Joi = require('joi')
 const { BaseJsonService } = require('..')
-const { renderVersionBadge } = require('../../lib/version')
-const { latest: latestVersion } = require('../../lib/version')
+const { latest, renderVersionBadge } = require('../version')
 
 const schema = Joi.object({
   versions: Joi.array()
@@ -57,7 +56,7 @@ module.exports = class PubVersion extends BaseJsonService {
     const data = await this.fetch({ packageName })
     const includePre = which === 'vpre'
     const versions = data.versions
-    const version = latestVersion(versions, { pre: includePre })
+    const version = latest(versions, { pre: includePre })
     return renderVersionBadge({ version })
   }
 }
diff --git a/services/puppetforge/puppetforge-modules.service.js b/services/puppetforge/puppetforge-modules.service.js
index f49c7ce93e..7ccbfe6f02 100644
--- a/services/puppetforge/puppetforge-modules.service.js
+++ b/services/puppetforge/puppetforge-modules.service.js
@@ -5,12 +5,12 @@ const {
   makeBadgeData: getBadgeData,
   makeLabel: getLabel,
 } = require('../../lib/badge-data')
-const { metric, addv: versionText } = require('../../lib/text-formatters')
+const { metric, addv: versionText } = require('../text-formatters')
 const {
   version: versionColor,
   coveragePercentage: coveragePercentageColor,
   downloadCount: downloadCountColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 
 class PuppetforgeModuleVersion extends LegacyService {
   static get category() {
diff --git a/services/puppetforge/puppetforge-users.service.js b/services/puppetforge/puppetforge-users.service.js
index 0b2ecb346f..d8d28ebc42 100644
--- a/services/puppetforge/puppetforge-users.service.js
+++ b/services/puppetforge/puppetforge-users.service.js
@@ -5,8 +5,8 @@ const {
   makeBadgeData: getBadgeData,
   makeLabel: getLabel,
 } = require('../../lib/badge-data')
-const { metric } = require('../../lib/text-formatters')
-const { floorCount: floorCountColor } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { floorCount: floorCountColor } = require('../color-formatters')
 
 class PuppetforgeUserReleases extends LegacyService {
   static get category() {
diff --git a/services/pypi/pypi-downloads.service.js b/services/pypi/pypi-downloads.service.js
index 1ff9f69fd6..6cd768d69d 100644
--- a/services/pypi/pypi-downloads.service.js
+++ b/services/pypi/pypi-downloads.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { downloadCount } = require('../../lib/color-formatters')
-const { metric } = require('../../lib/text-formatters')
+const { downloadCount } = require('../color-formatters')
+const { metric } = require('../text-formatters')
 const { BaseJsonService } = require('..')
 const { nonNegativeInteger } = require('../validators')
 
diff --git a/services/pypi/pypi-license.service.js b/services/pypi/pypi-license.service.js
index a9217c9dcc..cf65aa403c 100644
--- a/services/pypi/pypi-license.service.js
+++ b/services/pypi/pypi-license.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderLicenseBadge } = require('../../lib/licenses')
+const { renderLicenseBadge } = require('../licenses')
 const PypiBase = require('./pypi-base')
 const { getLicenses } = require('./pypi-helpers')
 
diff --git a/services/pypi/pypi-version.service.js b/services/pypi/pypi-version.service.js
index 39cc3d7f8c..cee37daafc 100644
--- a/services/pypi/pypi-version.service.js
+++ b/services/pypi/pypi-version.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const PypiBase = require('./pypi-base')
 
 module.exports = class PypiVersion extends PypiBase {
diff --git a/services/readthedocs/readthedocs.service.js b/services/readthedocs/readthedocs.service.js
index 1108b09a43..a9537f108f 100644
--- a/services/readthedocs/readthedocs.service.js
+++ b/services/readthedocs/readthedocs.service.js
@@ -1,10 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const {
-  isBuildStatus,
-  renderBuildStatusBadge,
-} = require('../../lib/build-status')
+const { isBuildStatus, renderBuildStatusBadge } = require('../build-status')
 const { BaseSvgScrapingService, NotFound } = require('..')
 
 const keywords = ['documentation']
diff --git a/services/redmine/redmine.service.js b/services/redmine/redmine.service.js
index 840edddad2..9f7b0974c3 100644
--- a/services/redmine/redmine.service.js
+++ b/services/redmine/redmine.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { starRating } = require('../../lib/text-formatters')
-const { floorCount: floorCountColor } = require('../../lib/color-formatters')
+const { starRating } = require('../text-formatters')
+const { floorCount: floorCountColor } = require('../color-formatters')
 const Joi = require('joi')
 const { BaseXmlService } = require('..')
 
diff --git a/services/scrutinizer/scrutinizer.service.js b/services/scrutinizer/scrutinizer.service.js
index 7007d4725e..9b433d737c 100644
--- a/services/scrutinizer/scrutinizer.service.js
+++ b/services/scrutinizer/scrutinizer.service.js
@@ -5,7 +5,7 @@ const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { checkErrorResponse } = require('../../lib/error-helper')
 const {
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 
 class ScrutinizerBuild extends LegacyService {
   static get category() {
diff --git a/services/shippable/shippable.service.js b/services/shippable/shippable.service.js
index 3296022f09..228b75ce89 100644
--- a/services/shippable/shippable.service.js
+++ b/services/shippable/shippable.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderBuildStatusBadge } = require('../../lib/build-status')
+const { renderBuildStatusBadge } = require('../build-status')
 const { BaseJsonService, NotFound } = require('..')
 
 // source: https://github.com/badges/shields/pull/1362#discussion_r161693830
diff --git a/services/sonarqube/sonarqube.service.js b/services/sonarqube/sonarqube.service.js
index 7671248275..784f815918 100644
--- a/services/sonarqube/sonarqube.service.js
+++ b/services/sonarqube/sonarqube.service.js
@@ -3,10 +3,10 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const serverSecrets = require('../../lib/server-secrets')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 const {
   coveragePercentage: coveragePercentageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 
 class SonarqubeCoverage extends LegacyService {
   static get category() {
diff --git a/services/sourceforge/sourceforge.service.js b/services/sourceforge/sourceforge.service.js
index f9359c0b1c..aad987bab6 100644
--- a/services/sourceforge/sourceforge.service.js
+++ b/services/sourceforge/sourceforge.service.js
@@ -6,10 +6,8 @@ const {
   makeBadgeData: getBadgeData,
   makeLabel: getLabel,
 } = require('../../lib/badge-data')
-const { metric } = require('../../lib/text-formatters')
-const {
-  downloadCount: downloadCountColor,
-} = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount: downloadCountColor } = require('../color-formatters')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/services/spiget/spiget-downloads.service.js b/services/spiget/spiget-downloads.service.js
index 62f90aeb77..632c8983b0 100644
--- a/services/spiget/spiget-downloads.service.js
+++ b/services/spiget/spiget-downloads.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount } = require('../color-formatters')
 const { BaseSpigetService, documentation, keywords } = require('./spiget-base')
 
 module.exports = class SpigetDownloads extends BaseSpigetService {
diff --git a/services/spiget/spiget-rating.service.js b/services/spiget/spiget-rating.service.js
index d2cd6b7772..dc410983e4 100644
--- a/services/spiget/spiget-rating.service.js
+++ b/services/spiget/spiget-rating.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { starRating, metric } = require('../../lib/text-formatters')
-const { floorCount } = require('../../lib/color-formatters')
+const { starRating, metric } = require('../text-formatters')
+const { floorCount } = require('../color-formatters')
 const { BaseSpigetService, documentation, keywords } = require('./spiget-base')
 
 module.exports = class SpigetRatings extends BaseSpigetService {
diff --git a/services/stackexchange/stackexchange-helpers.js b/services/stackexchange/stackexchange-helpers.js
index 239a91eafc..edb85404be 100644
--- a/services/stackexchange/stackexchange-helpers.js
+++ b/services/stackexchange/stackexchange-helpers.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
-const { floorCount: floorCountColor } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { floorCount: floorCountColor } = require('../color-formatters')
 
 module.exports = function renderQuestionsBadge({
   suffix,
diff --git a/services/stackexchange/stackexchange-reputation.service.js b/services/stackexchange/stackexchange-reputation.service.js
index c71a1efd21..597fd44527 100644
--- a/services/stackexchange/stackexchange-reputation.service.js
+++ b/services/stackexchange/stackexchange-reputation.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
-const { floorCount: floorCountColor } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { floorCount: floorCountColor } = require('../color-formatters')
 const { BaseJsonService } = require('..')
 
 const reputationSchema = Joi.object({
diff --git a/services/steam/steam-workshop.service.js b/services/steam/steam-workshop.service.js
index 21f94cf2a0..608086159f 100644
--- a/services/steam/steam-workshop.service.js
+++ b/services/steam/steam-workshop.service.js
@@ -2,8 +2,8 @@
 
 const Joi = require('joi')
 const prettyBytes = require('pretty-bytes')
-const { metric, formatDate } = require('../../lib/text-formatters')
-const { age: ageColor, downloadCount } = require('../../lib/color-formatters')
+const { metric, formatDate } = require('../text-formatters')
+const { age: ageColor, downloadCount } = require('../color-formatters')
 const { NotFound } = require('..')
 const BaseSteamAPI = require('./steam-base')
 
diff --git a/services/symfony/symfony-insight-stars.service.js b/services/symfony/symfony-insight-stars.service.js
index e2f52a7395..a66eac4ca2 100644
--- a/services/symfony/symfony-insight-stars.service.js
+++ b/services/symfony/symfony-insight-stars.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { starRating } = require('../../lib/text-formatters')
+const { starRating } = require('../text-formatters')
 const {
   SymfonyInsightBase,
   keywords,
diff --git a/services/teamcity/teamcity-coverage.service.js b/services/teamcity/teamcity-coverage.service.js
index 5d27f6dc09..f89d1e8133 100644
--- a/services/teamcity/teamcity-coverage.service.js
+++ b/services/teamcity/teamcity-coverage.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { coveragePercentage } = require('../../lib/color-formatters')
+const { coveragePercentage } = require('../color-formatters')
 const { InvalidResponse } = require('..')
 const TeamCityBase = require('./teamcity-base')
 
diff --git a/lib/text-formatters.js b/services/text-formatters.js
similarity index 100%
rename from lib/text-formatters.js
rename to services/text-formatters.js
diff --git a/lib/text-formatters.spec.js b/services/text-formatters.spec.js
similarity index 100%
rename from lib/text-formatters.spec.js
rename to services/text-formatters.spec.js
diff --git a/services/travis/travis-build.service.js b/services/travis/travis-build.service.js
index 943c6f5c12..f601031af0 100644
--- a/services/travis/travis-build.service.js
+++ b/services/travis/travis-build.service.js
@@ -1,10 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const {
-  isBuildStatus,
-  renderBuildStatusBadge,
-} = require('../../lib/build-status')
+const { isBuildStatus, renderBuildStatusBadge } = require('../build-status')
 const { BaseSvgScrapingService } = require('..')
 
 const schema = Joi.object({
diff --git a/services/travis/travis-php-version.service.js b/services/travis/travis-php-version.service.js
index fa0cdc2c9f..63879a5e42 100644
--- a/services/travis/travis-php-version.service.js
+++ b/services/travis/travis-php-version.service.js
@@ -7,7 +7,7 @@ const {
   minorVersion: phpMinorVersion,
   versionReduction: phpVersionReduction,
   getPhpReleases,
-} = require('../../lib/php-version')
+} = require('../php-version')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/services/twitter/twitter.service.js b/services/twitter/twitter.service.js
index e6b7698de1..3aea7a00b2 100644
--- a/services/twitter/twitter.service.js
+++ b/services/twitter/twitter.service.js
@@ -3,7 +3,7 @@
 const LegacyService = require('../legacy-service')
 const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
 const { makeLogo: getLogo } = require('../../lib/logos')
-const { metric } = require('../../lib/text-formatters')
+const { metric } = require('../text-formatters')
 
 // This legacy service should be rewritten to use e.g. BaseJsonService.
 //
diff --git a/services/uptimerobot/uptimerobot-ratio.service.js b/services/uptimerobot/uptimerobot-ratio.service.js
index f15c1571af..06d4e897a2 100644
--- a/services/uptimerobot/uptimerobot-ratio.service.js
+++ b/services/uptimerobot/uptimerobot-ratio.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { colorScale } = require('../../lib/color-formatters')
+const { colorScale } = require('../color-formatters')
 const UptimeRobotBase = require('./uptimerobot-base')
 
 const ratioColor = colorScale([10, 30, 50, 70])
diff --git a/services/vaadin-directory/vaadin-directory.service.js b/services/vaadin-directory/vaadin-directory.service.js
index 94855a7129..08ebfc6803 100644
--- a/services/vaadin-directory/vaadin-directory.service.js
+++ b/services/vaadin-directory/vaadin-directory.service.js
@@ -6,11 +6,11 @@ const {
   makeLabel: getLabel,
 } = require('../../lib/badge-data')
 const { checkErrorResponse } = require('../../lib/error-helper')
-const { metric, starRating, formatDate } = require('../../lib/text-formatters')
+const { metric, starRating, formatDate } = require('../text-formatters')
 const {
   floorCount: floorCountColor,
   age: ageColor,
-} = require('../../lib/color-formatters')
+} = require('../color-formatters')
 
 class VaadinDirectoryRating extends LegacyService {
   static get category() {
diff --git a/lib/version.js b/services/version.js
similarity index 100%
rename from lib/version.js
rename to services/version.js
diff --git a/lib/version.spec.js b/services/version.spec.js
similarity index 100%
rename from lib/version.spec.js
rename to services/version.spec.js
diff --git a/services/visual-studio-marketplace/visual-studio-marketplace-azure-devops-installs.service.js b/services/visual-studio-marketplace/visual-studio-marketplace-azure-devops-installs.service.js
index 212103b6a8..877c139c07 100644
--- a/services/visual-studio-marketplace/visual-studio-marketplace-azure-devops-installs.service.js
+++ b/services/visual-studio-marketplace/visual-studio-marketplace-azure-devops-installs.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount } = require('../color-formatters')
 const VisualStudioMarketplaceBase = require('./visual-studio-marketplace-base')
 
 const documentation = `
diff --git a/services/visual-studio-marketplace/visual-studio-marketplace-downloads.service.js b/services/visual-studio-marketplace/visual-studio-marketplace-downloads.service.js
index 3f9594c5ba..2317d1894a 100644
--- a/services/visual-studio-marketplace/visual-studio-marketplace-downloads.service.js
+++ b/services/visual-studio-marketplace/visual-studio-marketplace-downloads.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount } = require('../color-formatters')
 const VisualStudioMarketplaceBase = require('./visual-studio-marketplace-base')
 
 const documentation = `
diff --git a/services/visual-studio-marketplace/visual-studio-marketplace-rating.service.js b/services/visual-studio-marketplace/visual-studio-marketplace-rating.service.js
index 158674ae97..fe748619c2 100644
--- a/services/visual-studio-marketplace/visual-studio-marketplace-rating.service.js
+++ b/services/visual-studio-marketplace/visual-studio-marketplace-rating.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { starRating } = require('../../lib/text-formatters')
-const { floorCount } = require('../../lib/color-formatters')
+const { starRating } = require('../text-formatters')
+const { floorCount } = require('../color-formatters')
 const VisualStudioMarketplaceBase = require('./visual-studio-marketplace-base')
 
 module.exports = class VisualStudioMarketplaceRating extends VisualStudioMarketplaceBase {
diff --git a/services/visual-studio-marketplace/visual-studio-marketplace-version.service.js b/services/visual-studio-marketplace/visual-studio-marketplace-version.service.js
index c17056515a..7431fbdcd4 100644
--- a/services/visual-studio-marketplace/visual-studio-marketplace-version.service.js
+++ b/services/visual-studio-marketplace/visual-studio-marketplace-version.service.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const VisualStudioMarketplaceBase = require('./visual-studio-marketplace-base')
 
 module.exports = class VisualStudioMarketplaceVersion extends VisualStudioMarketplaceBase {
diff --git a/services/wercker/wercker.service.js b/services/wercker/wercker.service.js
index 45278d6334..24a32c83f0 100644
--- a/services/wercker/wercker.service.js
+++ b/services/wercker/wercker.service.js
@@ -1,10 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const {
-  isBuildStatus,
-  renderBuildStatusBadge,
-} = require('../../lib/build-status')
+const { isBuildStatus, renderBuildStatusBadge } = require('../build-status')
 const { BaseJsonService } = require('..')
 
 const werckerSchema = Joi.array()
diff --git a/services/wordpress/wordpress-downloads.service.js b/services/wordpress/wordpress-downloads.service.js
index 459b77a1d6..c0151152d0 100644
--- a/services/wordpress/wordpress-downloads.service.js
+++ b/services/wordpress/wordpress-downloads.service.js
@@ -1,8 +1,8 @@
 'use strict'
 
 const Joi = require('joi')
-const { metric } = require('../../lib/text-formatters')
-const { downloadCount } = require('../../lib/color-formatters')
+const { metric } = require('../text-formatters')
+const { downloadCount } = require('../color-formatters')
 const { BaseJsonService, NotFound } = require('..')
 const BaseWordpress = require('./wordpress-base')
 
diff --git a/services/wordpress/wordpress-platform.service.js b/services/wordpress/wordpress-platform.service.js
index 4eb073edbd..18611d8f67 100644
--- a/services/wordpress/wordpress-platform.service.js
+++ b/services/wordpress/wordpress-platform.service.js
@@ -2,8 +2,8 @@
 
 const semver = require('semver')
 const Joi = require('joi')
-const { addv } = require('../../lib/text-formatters')
-const { version: versionColor } = require('../../lib/color-formatters')
+const { addv } = require('../text-formatters')
+const { version: versionColor } = require('../color-formatters')
 const { NotFound } = require('..')
 const BaseWordpress = require('./wordpress-base')
 
diff --git a/services/wordpress/wordpress-rating.service.js b/services/wordpress/wordpress-rating.service.js
index dcabd1d914..ceb5219cc9 100644
--- a/services/wordpress/wordpress-rating.service.js
+++ b/services/wordpress/wordpress-rating.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { starRating, metric } = require('../../lib/text-formatters')
-const { floorCount } = require('../../lib/color-formatters')
+const { starRating, metric } = require('../text-formatters')
+const { floorCount } = require('../color-formatters')
 const BaseWordpress = require('./wordpress-base')
 
 const extensionData = {
diff --git a/services/wordpress/wordpress-version.service.js b/services/wordpress/wordpress-version.service.js
index 259cad3f13..1c8ae711df 100644
--- a/services/wordpress/wordpress-version.service.js
+++ b/services/wordpress/wordpress-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
-const { addv } = require('../../lib/text-formatters')
-const { version: versionColor } = require('../../lib/color-formatters')
+const { addv } = require('../text-formatters')
+const { version: versionColor } = require('../color-formatters')
 const BaseWordpress = require('./wordpress-base')
 
 function VersionForExtensionType(extensionType) {


Test patch:
diff --git a/core/service-test-runner/cli.js b/core/service-test-runner/cli.js
index 4901085d27..da4629a0d3 100644
--- a/core/service-test-runner/cli.js
+++ b/core/service-test-runner/cli.js
@@ -57,7 +57,7 @@ const readAllStdinSync = require('read-all-stdin-sync')
 const { createTestServer } = require('../server/in-process-server-test-helpers')
 const Runner = require('./runner')
 
-require('../../lib/unhandled-rejection.spec')
+require('../unhandled-rejection.spec')
 
 let baseUrl, server
 if (process.env.TESTED_SERVER_URL) {
diff --git a/services/appveyor/appveyor-ci.tester.js b/services/appveyor/appveyor-ci.tester.js
index 8128f84af8..ae7eaea86f 100644
--- a/services/appveyor/appveyor-ci.tester.js
+++ b/services/appveyor/appveyor-ci.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 
 t.create('CI status')
diff --git a/services/appveyor/appveyor-tests.service.js b/services/appveyor/appveyor-tests.service.js
index 2b7f5fe740..0f7a1fdcbf 100644
--- a/services/appveyor/appveyor-tests.service.js
+++ b/services/appveyor/appveyor-tests.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderTestResultBadge } = require('../../lib/text-formatters')
+const { renderTestResultBadge } = require('../text-formatters')
 const AppVeyorBase = require('./appveyor-base')
 
 const documentation = `
diff --git a/services/azure-devops/azure-devops-build.tester.js b/services/azure-devops/azure-devops-build.tester.js
index 8e487895fe..ff5378a98c 100644
--- a/services/azure-devops/azure-devops-build.tester.js
+++ b/services/azure-devops/azure-devops-build.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 
 // https://dev.azure.com/totodem/Shields.io is a public Azure DevOps project
diff --git a/services/azure-devops/azure-devops-release.tester.js b/services/azure-devops/azure-devops-release.tester.js
index fe7b0acf6d..03817052d0 100644
--- a/services/azure-devops/azure-devops-release.tester.js
+++ b/services/azure-devops/azure-devops-release.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 
 // https://dev.azure.com/totodem/Shields.io is a public Azure DevOps project
diff --git a/services/azure-devops/azure-devops-tests.service.js b/services/azure-devops/azure-devops-tests.service.js
index daf5f9e24a..8663da3d12 100644
--- a/services/azure-devops/azure-devops-tests.service.js
+++ b/services/azure-devops/azure-devops-tests.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderTestResultBadge } = require('../../lib/text-formatters')
+const { renderTestResultBadge } = require('../text-formatters')
 const AzureDevOpsBase = require('./azure-devops-base')
 const { getHeaders } = require('./azure-devops-helpers')
 
diff --git a/services/bitbucket/bitbucket.tester.js b/services/bitbucket/bitbucket.tester.js
index 83eae86e2b..0ce8e7f31e 100644
--- a/services/bitbucket/bitbucket.tester.js
+++ b/services/bitbucket/bitbucket.tester.js
@@ -3,7 +3,7 @@
 const Joi = require('joi')
 const { ServiceTester } = require('../tester')
 const { isMetric, isMetricOpenIssues } = require('../test-validators')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const {
   mockBitbucketCreds,
   mockBitbucketServerCreds,
diff --git a/lib/build-status.js b/services/build-status.js
similarity index 100%
rename from lib/build-status.js
rename to services/build-status.js
diff --git a/lib/build-status.spec.js b/services/build-status.spec.js
similarity index 100%
rename from lib/build-status.spec.js
rename to services/build-status.spec.js
diff --git a/services/buildkite/buildkite.tester.js b/services/buildkite/buildkite.tester.js
index 95c7a3a392..de2f5069fb 100644
--- a/services/buildkite/buildkite.tester.js
+++ b/services/buildkite/buildkite.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const { invalidJSON } = require('../response-fixtures')
 const { ServiceTester } = require('../tester')
 
diff --git a/services/circleci/circleci.tester.js b/services/circleci/circleci.tester.js
index c27a34f5a5..745cfe9632 100644
--- a/services/circleci/circleci.tester.js
+++ b/services/circleci/circleci.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const { ServiceTester } = require('../tester')
 
 const t = (module.exports = new ServiceTester({
diff --git a/services/codeship/codeship.tester.js b/services/codeship/codeship.tester.js
index ea2009cb28..cd61b6457a 100644
--- a/services/codeship/codeship.tester.js
+++ b/services/codeship/codeship.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const { ServiceTester } = require('../tester')
 
 const t = (module.exports = new ServiceTester({
diff --git a/services/continuousphp/continuousphp.tester.js b/services/continuousphp/continuousphp.tester.js
index 59516d6efc..60b211f6e0 100644
--- a/services/continuousphp/continuousphp.tester.js
+++ b/services/continuousphp/continuousphp.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 
 t.create('build status on default branch')
diff --git a/services/docker/docker-build.tester.js b/services/docker/docker-build.tester.js
index c2515fe247..591cea5c45 100644
--- a/services/docker/docker-build.tester.js
+++ b/services/docker/docker-build.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 const { dockerBlue } = require('./docker-helpers')
 
diff --git a/services/github/github-license.tester.js b/services/github/github-license.tester.js
index c482ce80f0..b3cf40d59a 100644
--- a/services/github/github-license.tester.js
+++ b/services/github/github-license.tester.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { licenseToColor } = require('../../lib/licenses')
+const { licenseToColor } = require('../licenses')
 const t = (module.exports = require('../tester').createServiceTester())
 
 const publicDomainLicenseColor = licenseToColor('CC0-1.0')
diff --git a/services/gitlab/gitlab-pipeline-status.tester.js b/services/gitlab/gitlab-pipeline-status.tester.js
index a0cdb600f4..9f93440095 100644
--- a/services/gitlab/gitlab-pipeline-status.tester.js
+++ b/services/gitlab/gitlab-pipeline-status.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 
 t.create('Pipeline status')
diff --git a/services/readthedocs/readthedocs.tester.js b/services/readthedocs/readthedocs.tester.js
index 4ee19c06fb..2258f34e9d 100644
--- a/services/readthedocs/readthedocs.tester.js
+++ b/services/readthedocs/readthedocs.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 
 t.create('build status')
diff --git a/services/scrutinizer/scrutinizer.tester.js b/services/scrutinizer/scrutinizer.tester.js
index e81bf0e2a7..38205c098c 100644
--- a/services/scrutinizer/scrutinizer.tester.js
+++ b/services/scrutinizer/scrutinizer.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const { ServiceTester } = require('../tester')
 const { isIntegerPercentage } = require('../test-validators')
 
diff --git a/services/shippable/shippable.tester.js b/services/shippable/shippable.tester.js
index aa6d19699a..10278ae1a2 100644
--- a/services/shippable/shippable.tester.js
+++ b/services/shippable/shippable.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 
 t.create('build status (valid, without branch)')
diff --git a/services/spiget/spiget-latest-version.service.js b/services/spiget/spiget-latest-version.service.js
index a2371ff0e2..0749f10ef1 100644
--- a/services/spiget/spiget-latest-version.service.js
+++ b/services/spiget/spiget-latest-version.service.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { renderVersionBadge } = require('../../lib/version')
+const { renderVersionBadge } = require('../version')
 const { BaseSpigetService, documentation, keywords } = require('./spiget-base')
 
 const versionSchema = Joi.object({
diff --git a/services/travis/travis-build.tester.js b/services/travis/travis-build.tester.js
index 78f05ec698..2182cc3588 100644
--- a/services/travis/travis-build.tester.js
+++ b/services/travis/travis-build.tester.js
@@ -1,7 +1,7 @@
 'use strict'
 
 const Joi = require('joi')
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const { ServiceTester } = require('../tester')
 
 const t = (module.exports = new ServiceTester({
diff --git a/services/wercker/wercker.tester.js b/services/wercker/wercker.tester.js
index 2539146ed7..ebe8a38af6 100644
--- a/services/wercker/wercker.tester.js
+++ b/services/wercker/wercker.tester.js
@@ -1,6 +1,6 @@
 'use strict'
 
-const { isBuildStatus } = require('../../lib/build-status')
+const { isBuildStatus } = require('../build-status')
 const t = (module.exports = require('../tester').createServiceTester())
 
 t.create('Build status')