Refactor learning tests.