refactor kernel to use streams and correct message format