refactor -- general cleanup of test code