Made some small refactoring to tests.