process data in a recursive way