Refactored repository reprocess and its tests

Signed-off By: Guilherme Rojas V. de Lima <guilhermehrojas@gmail.com>
Signed-off By: Rafael Reggiani Manzo <rr.manzo@gmail.com>