[j8] some refactors to learning tests