Copied current implementation from Learnful.