Move more logic to FileHistoryDao.