Use stream instead of file