Refactor contact stream function
Refactor group stream function