Refactor stream and observer creation
Add timeout to tests