Pull-review inspired refactoring

Attempts to reduce the complexity of the chunks of the test.