Test code refactored.