Started refactor tests code.