improved and refactored test runner