refactor receive chunk