Removing the immediate mode write stream logic to make refactoring easier.