Stream API, bugfixes and reorg