Move retrieval of debug stream into helper method