runtests refactored.