Fixed test run. Refactored