Refactors tests runner