refactor fit stream