Moves implementation details for tests into utilities.rb