impl astream and modify gstream internal interfaces